@isdk/ai-tool 0.2.2 → 0.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 (202) hide show
  1. package/dist/chunk-FLVJ4R53.mjs +1 -0
  2. package/dist/funcs.js +1 -1
  3. package/dist/funcs.mjs +1 -1
  4. package/dist/index.d.mts +33 -2
  5. package/dist/index.d.ts +33 -2
  6. package/dist/index.js +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/docs/classes/CancelableAbility.md +20 -20
  9. package/docs/classes/ClientTools.md +54 -54
  10. package/docs/classes/EventClient.md +76 -76
  11. package/docs/classes/EventServer.md +78 -78
  12. package/docs/classes/EventToolFunc.md +46 -46
  13. package/docs/classes/FStringPromptTemplate.md +18 -18
  14. package/docs/classes/FewShotPromptTemplate.md +22 -22
  15. package/docs/classes/GolangPromptTemplate.md +18 -18
  16. package/docs/classes/HFEnvironment.md +9 -9
  17. package/docs/classes/HFInterpreter.md +4 -4
  18. package/docs/classes/HFTemplate.md +4 -4
  19. package/docs/classes/HfPromptTemplate.md +18 -18
  20. package/docs/classes/IntSet.md +11 -11
  21. package/docs/classes/PromptExampleSelector.md +8 -8
  22. package/docs/classes/PromptTemplate.md +17 -17
  23. package/docs/classes/ReadableStreamError.md +1 -1
  24. package/docs/classes/ResClientTools.md +61 -61
  25. package/docs/classes/ResServerTools.md +62 -62
  26. package/docs/classes/SSEChannel.md +14 -14
  27. package/docs/classes/Semaphore.md +8 -8
  28. package/docs/classes/ServerTools.md +50 -50
  29. package/docs/classes/TaskAbortController.md +7 -7
  30. package/docs/classes/ToolFunc.md +43 -43
  31. package/docs/enumerations/AsyncFeatureBits.md +3 -3
  32. package/docs/enumerations/AsyncFeatures.md +3 -3
  33. package/docs/enumerations/XXHashAlgorithm.md +2 -2
  34. package/docs/functions/AIArgProcessor.md +1 -1
  35. package/docs/functions/AIStream.md +1 -1
  36. package/docs/functions/ChoiceArgProcessor.md +1 -1
  37. package/docs/functions/RateLimit.md +1 -1
  38. package/docs/functions/TemplateArgProcessor.md +1 -1
  39. package/docs/functions/backendEventable.md +1 -1
  40. package/docs/functions/countRegexMatches.md +1 -1
  41. package/docs/functions/createCallbacksTransformer.md +1 -1
  42. package/docs/functions/createEmptyReadableStream.md +1 -1
  43. package/docs/functions/createEndWithRepetitionDetector.md +1 -1
  44. package/docs/functions/createEventStreamTransformer.md +1 -1
  45. package/docs/functions/createHfValueFunc.md +1 -1
  46. package/docs/functions/createLRUCache.md +1 -1
  47. package/docs/functions/dateToText.md +1 -1
  48. package/docs/functions/expandEnv.md +1 -1
  49. package/docs/functions/expandObjEnv.md +1 -1
  50. package/docs/functions/extNameLevel.md +1 -1
  51. package/docs/functions/fileIsExists.md +1 -1
  52. package/docs/functions/filenameReservedRegex.md +1 -1
  53. package/docs/functions/filterValidFnScope.md +1 -1
  54. package/docs/functions/findPort.md +1 -1
  55. package/docs/functions/getAllEnumKeys.md +1 -1
  56. package/docs/functions/getConfigFileNames.md +1 -1
  57. package/docs/functions/getConfigs.md +1 -1
  58. package/docs/functions/getKeysPath.md +1 -1
  59. package/docs/functions/getMultiLevelExtname.md +1 -1
  60. package/docs/functions/getPackageDir.md +1 -1
  61. package/docs/functions/getRealFilepath.md +1 -1
  62. package/docs/functions/getResponseErrorReadableStream.md +1 -1
  63. package/docs/functions/hasDirectoryIn.md +38 -0
  64. package/docs/functions/hfParse.md +1 -1
  65. package/docs/functions/hfTokenize.md +1 -1
  66. package/docs/functions/interpolateEnv.md +1 -1
  67. package/docs/functions/interpolateFString.md +1 -1
  68. package/docs/functions/interpolateGolangTemplate.md +1 -1
  69. package/docs/functions/isModelNameMatched.md +1 -1
  70. package/docs/functions/isRegExp.md +21 -0
  71. package/docs/functions/isSubdirectory.md +39 -0
  72. package/docs/functions/isValidFilename.md +1 -1
  73. package/docs/functions/isValidFilepath.md +1 -1
  74. package/docs/functions/isWebStream.md +1 -1
  75. package/docs/functions/jsonFilterToWhere.md +1 -1
  76. package/docs/functions/jsonToMarkdownStr.md +1 -1
  77. package/docs/functions/loadFileFromPaths.md +1 -1
  78. package/docs/functions/loadTextFromPaths.md +1 -1
  79. package/docs/functions/lrucache.md +1 -1
  80. package/docs/functions/makeToolFuncCancelable.md +1 -1
  81. package/docs/functions/matchUrlProtocol.md +1 -1
  82. package/docs/functions/memoize.md +1 -1
  83. package/docs/functions/messagesToText.md +1 -1
  84. package/docs/functions/paramsSizeToScaleStr.md +1 -1
  85. package/docs/functions/parseCommand.md +1 -1
  86. package/docs/functions/parseFString.md +1 -1
  87. package/docs/functions/parseJsJson.md +1 -1
  88. package/docs/functions/parseObjectArgInfo.md +1 -1
  89. package/docs/functions/parseObjectArgumentInfos.md +1 -1
  90. package/docs/functions/parseObjectArguments.md +1 -1
  91. package/docs/functions/parseObjectArgumentsAsArgInfos.md +1 -1
  92. package/docs/functions/parseYaml.md +1 -1
  93. package/docs/functions/quoteStr.md +1 -1
  94. package/docs/functions/reControlCharsRegex.md +1 -1
  95. package/docs/functions/readFilenamesRecursiveSync.md +1 -1
  96. package/docs/functions/readableFromAsyncIterable.md +1 -1
  97. package/docs/functions/registerCoreTools.md +1 -1
  98. package/docs/functions/registerYamlTag.md +1 -1
  99. package/docs/functions/sanitizeFilename.md +1 -1
  100. package/docs/functions/sanitizeFilepath.md +1 -1
  101. package/docs/functions/saveConfigFile.md +1 -1
  102. package/docs/functions/scaleStrToParamsSize.md +1 -1
  103. package/docs/functions/simplifyObjectArguments.md +1 -1
  104. package/docs/functions/sortedValues.md +1 -1
  105. package/docs/functions/splitSentence.md +1 -1
  106. package/docs/functions/stringifyYaml.md +6 -34
  107. package/docs/functions/textToDate.md +1 -1
  108. package/docs/functions/toDateTime.md +1 -1
  109. package/docs/functions/toRegExp.md +34 -0
  110. package/docs/functions/trimStartOfStreamHelper.md +1 -1
  111. package/docs/functions/truncTo.md +1 -1
  112. package/docs/functions/uuid.md +1 -1
  113. package/docs/functions/wait.md +1 -1
  114. package/docs/functions/xxhash.md +1 -1
  115. package/docs/functions/xxhash32.md +1 -1
  116. package/docs/functions/xxhash64.md +1 -1
  117. package/docs/functions/xxhashAsStr.md +1 -1
  118. package/docs/globals.md +4 -0
  119. package/docs/interfaces/AIChatAssistantMessageParam.md +6 -6
  120. package/docs/interfaces/AIChatContentPartImage.md +2 -2
  121. package/docs/interfaces/AIChatContentPartText.md +2 -2
  122. package/docs/interfaces/AIChatMessageParamBase.md +1 -1
  123. package/docs/interfaces/AIChatMessageToolCall.md +3 -3
  124. package/docs/interfaces/AIChatSystemMessageParam.md +3 -3
  125. package/docs/interfaces/AIChatToolMessageParam.md +4 -4
  126. package/docs/interfaces/AIChatUserMessageParam.md +7 -7
  127. package/docs/interfaces/AIChoiceConfig.md +7 -7
  128. package/docs/interfaces/AIResult.md +5 -5
  129. package/docs/interfaces/AIStreamParser.md +1 -1
  130. package/docs/interfaces/AIStreamParserOptions.md +1 -1
  131. package/docs/interfaces/BaseFunc.md +9 -9
  132. package/docs/interfaces/BaseFuncItem.md +8 -8
  133. package/docs/interfaces/CancelableAbilityOptions.md +2 -2
  134. package/docs/interfaces/ClientFuncItem.md +11 -11
  135. package/docs/interfaces/DotenvExpandOptions.md +3 -3
  136. package/docs/interfaces/DotenvExpandOutput.md +2 -2
  137. package/docs/interfaces/EventClientFuncParams.md +4 -4
  138. package/docs/interfaces/EventServerFuncParams.md +5 -5
  139. package/docs/interfaces/FewShotPromptTemplateOptions.md +11 -11
  140. package/docs/interfaces/FuncItem.md +9 -9
  141. package/docs/interfaces/FuncParam.md +6 -6
  142. package/docs/interfaces/ParseObjectArgumentOptions.md +5 -5
  143. package/docs/interfaces/PromptExampleSelectorOptions.md +2 -2
  144. package/docs/interfaces/PromptTemplateOptions.md +6 -6
  145. package/docs/interfaces/RemoteFuncItem.md +11 -11
  146. package/docs/interfaces/ResClientFuncParams.md +2 -2
  147. package/docs/interfaces/ResServerFuncParams.md +5 -5
  148. package/docs/interfaces/SanitizeFilenameOptions.md +2 -2
  149. package/docs/interfaces/ServerFuncItem.md +12 -12
  150. package/docs/interfaces/ServerFuncParams.md +2 -2
  151. package/docs/interfaces/StreamCallbacksAndOptions.md +4 -4
  152. package/docs/interfaces/TaskPromise.md +1 -1
  153. package/docs/interfaces/ToolFuncPackage.md +3 -3
  154. package/docs/type-aliases/AIChatContentPart.md +1 -1
  155. package/docs/type-aliases/AIChatMessageParam.md +1 -1
  156. package/docs/type-aliases/AIChatRole.md +1 -1
  157. package/docs/type-aliases/AIMessageType.md +1 -1
  158. package/docs/type-aliases/AIModelNameRule.md +1 -1
  159. package/docs/type-aliases/AIModelNameRuleFn.md +1 -1
  160. package/docs/type-aliases/AIModelNameRules.md +1 -1
  161. package/docs/type-aliases/AITextGenerationFinishReason.md +1 -1
  162. package/docs/type-aliases/ActionName.md +1 -1
  163. package/docs/type-aliases/AsyncTaskId.md +1 -1
  164. package/docs/type-aliases/EventErrorListenerFn.md +1 -1
  165. package/docs/type-aliases/EventListenerFn.md +1 -1
  166. package/docs/type-aliases/FStringPromptTemplateNode.md +1 -1
  167. package/docs/type-aliases/FuncParamType.md +1 -1
  168. package/docs/type-aliases/PromptExamples.md +1 -1
  169. package/docs/type-aliases/PromptTemplateType.md +1 -1
  170. package/docs/type-aliases/PromptType.md +1 -1
  171. package/docs/type-aliases/TFunc.md +1 -1
  172. package/docs/variables/AIChatRoles.md +1 -1
  173. package/docs/variables/AIMessageTypes.md +1 -1
  174. package/docs/variables/AITextGenerationFinishReasons.md +1 -1
  175. package/docs/variables/ActionNames.md +1 -1
  176. package/docs/variables/ClientToolFuncSchema.md +1 -1
  177. package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
  178. package/docs/variables/EventBusName.md +1 -1
  179. package/docs/variables/EventName.md +1 -1
  180. package/docs/variables/FilenameReservedRegex.md +1 -1
  181. package/docs/variables/HFBuiltins.md +1 -1
  182. package/docs/variables/PASSING_SCORE.md +1 -1
  183. package/docs/variables/PromptTemplateTypes.md +1 -1
  184. package/docs/variables/PromptTypes.md +1 -1
  185. package/docs/variables/RStreamErrCode.md +1 -1
  186. package/docs/variables/RemoteToolFuncSchema.md +1 -1
  187. package/docs/variables/ResponseRStreamErrCode.md +1 -1
  188. package/docs/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
  189. package/docs/variables/ServerToolFuncSchema.md +1 -1
  190. package/docs/variables/ToolAsyncCancelableBit.md +1 -1
  191. package/docs/variables/ToolAsyncMultiTaskBit.md +1 -1
  192. package/docs/variables/ToolAsyncPriorityBit.md +1 -1
  193. package/docs/variables/ToolFuncSchema.md +1 -1
  194. package/docs/variables/WindowsReservedNameRegex.md +1 -1
  195. package/docs/variables/base32768.md +1 -1
  196. package/docs/variables/defaultTemplateFormat.md +1 -1
  197. package/docs/variables/event.md +1 -1
  198. package/docs/variables/eventClient.md +1 -1
  199. package/docs/variables/eventServer.md +1 -1
  200. package/docs/variables/lrucache.md +1 -1
  201. package/package.json +1 -1
  202. package/dist/chunk-PY6NRGZE.mjs +0 -1
@@ -19,4 +19,4 @@ A compiled regular expression for reserved filename characters.
19
19
 
20
20
  ## Defined in
21
21
 
22
- [packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L42)
22
+ [packages/ai-tool/src/utils/filename.ts:42](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L42)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/parse-js-json.ts:33](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-js-json.ts#L33)
21
+ [packages/ai-tool/src/utils/parse-js-json.ts:33](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-js-json.ts#L33)
@@ -20,4 +20,4 @@
20
20
 
21
21
  ## Defined in
22
22
 
23
- [packages/ai-tool/src/utils/find-port.ts:3](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/find-port.ts#L3)
23
+ [packages/ai-tool/src/utils/find-port.ts:3](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/find-port.ts#L3)
@@ -28,4 +28,4 @@ An array containing all string keys of the specified enumeration.
28
28
 
29
29
  ## Defined in
30
30
 
31
- [packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/get-all-enum-keys.ts#L7)
31
+ [packages/ai-tool/src/utils/get-all-enum-keys.ts:7](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/get-all-enum-keys.ts#L7)
@@ -20,4 +20,4 @@
20
20
 
21
21
  ## Defined in
22
22
 
23
- [packages/ai-tool/src/utils/config.ts:56](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/config.ts#L56)
23
+ [packages/ai-tool/src/utils/config.ts:59](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L59)
@@ -20,4 +20,4 @@
20
20
 
21
21
  ## Defined in
22
22
 
23
- [packages/ai-tool/src/utils/config.ts:80](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/config.ts#L80)
23
+ [packages/ai-tool/src/utils/config.ts:83](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L83)
@@ -35,4 +35,4 @@ console.log(getKeysPath(obj)); // Output: ['a.b.c', 'd[0]', 'd[1].e']
35
35
 
36
36
  ## Defined in
37
37
 
38
- [packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/get-keys-path.ts#L16)
38
+ [packages/ai-tool/src/utils/get-keys-path.ts:16](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/get-keys-path.ts#L16)
@@ -28,4 +28,4 @@ Returns a concatenated string of multiple extensions, or an empty string if no e
28
28
 
29
29
  ## Defined in
30
30
 
31
- [packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L174)
31
+ [packages/ai-tool/src/utils/filename.ts:174](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L174)
@@ -36,4 +36,4 @@ console.log(packageDir); // Output: '/path/to/project'
36
36
 
37
37
  ## Defined in
38
38
 
39
- [packages/ai-tool/src/utils/get-package-dir.ts:18](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/get-package-dir.ts#L18)
39
+ [packages/ai-tool/src/utils/get-package-dir.ts:18](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/get-package-dir.ts#L18)
@@ -31,4 +31,4 @@ console.log(realPath); // Outputs the resolved path.
31
31
 
32
32
  ## Defined in
33
33
 
34
- [packages/ai-tool/src/utils/load-file-from-paths.ts:172](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/load-file-from-paths.ts#L172)
34
+ [packages/ai-tool/src/utils/load-file-from-paths.ts:172](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/load-file-from-paths.ts#L172)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/stream/error-readable-stream.ts#L12)
21
+ [packages/ai-tool/src/utils/stream/error-readable-stream.ts:12](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/stream/error-readable-stream.ts#L12)
@@ -0,0 +1,38 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / hasDirectoryIn
6
+
7
+ # Function: hasDirectoryIn()
8
+
9
+ > **hasDirectoryIn**(`dir`, `dirs`?): `undefined` \| `boolean`
10
+
11
+ Checks if a given directory is a subdirectory of any directory in the provided array.
12
+
13
+ ## Parameters
14
+
15
+ • **dir**: `string`
16
+
17
+ The directory path to check.
18
+
19
+ • **dirs?**: `string`[]
20
+
21
+ An array of directory paths.
22
+
23
+ ## Returns
24
+
25
+ `undefined` \| `boolean`
26
+
27
+ true if the given directory is a subdirectory of any directory in the array; otherwise, false.
28
+
29
+ ## Example
30
+
31
+ ```ts
32
+ // Returns true if 'subdir' is within 'parentdir'
33
+ hasDirectoryIn('parentdir/subdir', ['parentdir', 'otherdir']); // true
34
+ ```
35
+
36
+ ## Defined in
37
+
38
+ [packages/ai-tool/src/utils/has-directory-in.ts:37](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/has-directory-in.ts#L37)
@@ -21,4 +21,4 @@ Operator precedence can be found here: https://developer.mozilla.org/en-US/docs/
21
21
 
22
22
  ## Defined in
23
23
 
24
- [packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:32](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/jinja/src/parser.ts#L32)
24
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/parser.ts:32](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/jinja/src/parser.ts#L32)
@@ -22,4 +22,4 @@ Generate a list of tokens from a source string.
22
22
 
23
23
  ## Defined in
24
24
 
25
- [packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:200](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/jinja/src/lexer.ts#L200)
25
+ [packages/ai-tool/src/utils/prompt/template/jinja/src/lexer.ts:200](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/jinja/src/lexer.ts#L200)
@@ -22,4 +22,4 @@
22
22
 
23
23
  ## Defined in
24
24
 
25
- [packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/env.ts#L17)
25
+ [packages/ai-tool/src/utils/prompt/template/env.ts:17](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/env.ts#L17)
@@ -24,4 +24,4 @@ template have been replaced with their corresponding values.
24
24
 
25
25
  ## Defined in
26
26
 
27
- [packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/python.ts#L71)
27
+ [packages/ai-tool/src/utils/prompt/template/python.ts:71](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/python.ts#L71)
@@ -28,4 +28,4 @@ object of variables to insert
28
28
 
29
29
  ## Defined in
30
30
 
31
- [packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/golang.ts#L269)
31
+ [packages/ai-tool/src/utils/prompt/template/golang.ts:269](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/golang.ts#L269)
@@ -42,4 +42,4 @@ IsModelNameMatched("gpt-2", (modelName) => modelName.startsWith("gpt-")) // retu
42
42
 
43
43
  ## Defined in
44
44
 
45
- [packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/is-model-name-matched.ts#L21)
45
+ [packages/ai-tool/src/utils/is-model-name-matched.ts:21](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/is-model-name-matched.ts#L21)
@@ -0,0 +1,21 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / isRegExp
6
+
7
+ # Function: isRegExp()
8
+
9
+ > **isRegExp**(`value`): `boolean`
10
+
11
+ ## Parameters
12
+
13
+ • **value**: `any`
14
+
15
+ ## Returns
16
+
17
+ `boolean`
18
+
19
+ ## Defined in
20
+
21
+ [packages/ai-tool/src/utils/isRegExp.ts:3](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/isRegExp.ts#L3)
@@ -0,0 +1,39 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / isSubdirectory
6
+
7
+ # Function: isSubdirectory()
8
+
9
+ > **isSubdirectory**(`parentDir`, `childDir`): `boolean`
10
+
11
+ Determines whether the `childDir` is a subdirectory of `parentDir`.
12
+
13
+ ## Parameters
14
+
15
+ • **parentDir**: `string`
16
+
17
+ The directory to check as the potential parent.
18
+
19
+ • **childDir**: `string`
20
+
21
+ The directory to check as the potential child.
22
+
23
+ ## Returns
24
+
25
+ `boolean`
26
+
27
+ true if `childDir` is a subdirectory of `parentDir`, otherwise false.
28
+
29
+ ## Example
30
+
31
+ ```typescript
32
+ const parentDir = '/usr/local';
33
+ const childDir = '/usr/local/include';
34
+ const result = isSubdirectory(parentDir, childDir); // true
35
+ ```
36
+
37
+ ## Defined in
38
+
39
+ [packages/ai-tool/src/utils/has-directory-in.ts:17](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/has-directory-in.ts#L17)
@@ -35,4 +35,4 @@ isValidFilename('my<file.txt'); // Returns false
35
35
 
36
36
  ## Defined in
37
37
 
38
- [packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L63)
38
+ [packages/ai-tool/src/utils/filename.ts:63](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L63)
@@ -24,4 +24,4 @@ A boolean indicating whether the filepath is valid. Returns true if valid; false
24
24
 
25
25
  ## Defined in
26
26
 
27
- [packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L72)
27
+ [packages/ai-tool/src/utils/filename.ts:72](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L72)
@@ -18,4 +18,4 @@ val is ReadableStream\<any\> \| WritableStream\<any\>
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/stream/is-web-stream.ts#L1)
21
+ [packages/ai-tool/src/utils/stream/is-web-stream.ts:1](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/stream/is-web-stream.ts#L1)
@@ -42,4 +42,4 @@ console.log(jsonFilterToWhere(jsonFilter)); // Outputs a WHERE clause based on t
42
42
 
43
43
  ## Defined in
44
44
 
45
- [packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/json-filter.ts#L123)
45
+ [packages/ai-tool/src/utils/json-filter.ts:123](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/json-filter.ts#L123)
@@ -28,4 +28,4 @@
28
28
 
29
29
  ## Defined in
30
30
 
31
- [packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/json-to-markdown-str.ts#L2)
31
+ [packages/ai-tool/src/utils/json-to-markdown-str.ts:2](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/json-to-markdown-str.ts#L2)
@@ -51,4 +51,4 @@ const content = loadFileFromPaths('config', ['/etc', '/usr/local/etc'], ['.json'
51
51
 
52
52
  ## Defined in
53
53
 
54
- [packages/ai-tool/src/utils/load-file-from-paths.ts:39](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/load-file-from-paths.ts#L39)
54
+ [packages/ai-tool/src/utils/load-file-from-paths.ts:39](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/load-file-from-paths.ts#L39)
@@ -26,4 +26,4 @@
26
26
 
27
27
  ## Defined in
28
28
 
29
- [packages/ai-tool/src/utils/load-file-from-paths.ts:96](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/load-file-from-paths.ts#L96)
29
+ [packages/ai-tool/src/utils/load-file-from-paths.ts:96](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/load-file-from-paths.ts#L96)
@@ -26,4 +26,4 @@
26
26
 
27
27
  ## Defined in
28
28
 
29
- [packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/funcs/lrucache.ts#L6)
29
+ [packages/ai-tool/src/funcs/lrucache.ts:6](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/funcs/lrucache.ts#L6)
@@ -20,4 +20,4 @@
20
20
 
21
21
  ## Defined in
22
22
 
23
- [packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/cancelable-ability.ts#L340)
23
+ [packages/ai-tool/src/utils/cancelable-ability.ts:340](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/cancelable-ability.ts#L340)
@@ -45,4 +45,4 @@ matchUrlProtocol("noProtocolHere");
45
45
 
46
46
  ## Defined in
47
47
 
48
- [packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/match-url-protocol.ts#L23)
48
+ [packages/ai-tool/src/utils/match-url-protocol.ts:23](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/match-url-protocol.ts#L23)
@@ -24,4 +24,4 @@
24
24
 
25
25
  ## Defined in
26
26
 
27
- [packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/memoize.ts#L14)
27
+ [packages/ai-tool/src/utils/memoize.ts:14](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/memoize.ts#L14)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/chat.ts:118](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/chat.ts#L118)
21
+ [packages/ai-tool/src/utils/chat.ts:118](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/chat.ts#L118)
@@ -29,4 +29,4 @@ A string representing the formatted parameter size with the appropriate scale un
29
29
 
30
30
  ## Defined in
31
31
 
32
- [packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/convert-params-size.ts#L11)
32
+ [packages/ai-tool/src/utils/convert-params-size.ts:11](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/convert-params-size.ts#L11)
@@ -30,4 +30,4 @@
30
30
 
31
31
  ## Defined in
32
32
 
33
- [packages/ai-tool/src/utils/parse-command.ts:377](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L377)
33
+ [packages/ai-tool/src/utils/parse-command.ts:377](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L377)
@@ -23,4 +23,4 @@ extract from langchain.js/langchain-core/src/prompts/template.ts
23
23
 
24
24
  ## Defined in
25
25
 
26
- [packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/template/python.ts#L16)
26
+ [packages/ai-tool/src/utils/prompt/template/python.ts:16](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/template/python.ts#L16)
@@ -35,4 +35,4 @@ console.log(json); // { name: 'John' }
35
35
 
36
36
  ## Defined in
37
37
 
38
- [packages/ai-tool/src/utils/parse-js-json.ts:15](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-js-json.ts#L15)
38
+ [packages/ai-tool/src/utils/parse-js-json.ts:15](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-js-json.ts#L15)
@@ -24,4 +24,4 @@
24
24
 
25
25
  ## Defined in
26
26
 
27
- [packages/ai-tool/src/utils/parse-command.ts:226](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L226)
27
+ [packages/ai-tool/src/utils/parse-command.ts:226](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L226)
@@ -22,4 +22,4 @@
22
22
 
23
23
  ## Defined in
24
24
 
25
- [packages/ai-tool/src/utils/parse-command.ts:88](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L88)
25
+ [packages/ai-tool/src/utils/parse-command.ts:88](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L88)
@@ -65,4 +65,4 @@ console.log(arrayResult); // Output: [1, 2, 3]
65
65
 
66
66
  ## Defined in
67
67
 
68
- [packages/ai-tool/src/utils/parse-command.ts:66](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L66)
68
+ [packages/ai-tool/src/utils/parse-command.ts:66](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L66)
@@ -39,4 +39,4 @@ An array of parsed argument information, where each item contains a boolean indi
39
39
 
40
40
  ## Defined in
41
41
 
42
- [packages/ai-tool/src/utils/parse-command.ts:285](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L285)
42
+ [packages/ai-tool/src/utils/parse-command.ts:285](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L285)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/config.ts:25](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/config.ts#L25)
21
+ [packages/ai-tool/src/utils/config.ts:24](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L24)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/parse-command.ts:200](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L200)
21
+ [packages/ai-tool/src/utils/parse-command.ts:200](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L200)
@@ -18,4 +18,4 @@ A compiled regular expression for control characters in a filename.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L50)
21
+ [packages/ai-tool/src/utils/filename.ts:50](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L50)
@@ -44,4 +44,4 @@ console.log(files); // Outputs an array of JavaScript file paths.
44
44
 
45
45
  ## Defined in
46
46
 
47
- [packages/ai-tool/src/utils/load-file-from-paths.ts:123](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/load-file-from-paths.ts#L123)
47
+ [packages/ai-tool/src/utils/load-file-from-paths.ts:123](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/load-file-from-paths.ts#L123)
@@ -25,4 +25,4 @@ https://github.com/whatwg/streams/commit/8d7a0bf26eb2cc23e884ddbaac7c1da4b91cf2b
25
25
 
26
26
  ## Defined in
27
27
 
28
- [packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/stream/ai-stream.ts#L166)
28
+ [packages/ai-tool/src/utils/stream/ai-stream.ts:166](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/stream/ai-stream.ts#L166)
@@ -14,4 +14,4 @@
14
14
 
15
15
  ## Defined in
16
16
 
17
- [packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/funcs/index.ts#L9)
17
+ [packages/ai-tool/src/funcs/index.ts:9](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/funcs/index.ts#L9)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/config.ts:15](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/config.ts#L15)
21
+ [packages/ai-tool/src/utils/config.ts:14](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L14)
@@ -34,4 +34,4 @@ The sanitized filename.
34
34
 
35
35
  ## Defined in
36
36
 
37
- [packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L97)
37
+ [packages/ai-tool/src/utils/filename.ts:97](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L97)
@@ -28,4 +28,4 @@ The sanitized file path as a string.
28
28
 
29
29
  ## Defined in
30
30
 
31
- [packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/filename.ts#L149)
31
+ [packages/ai-tool/src/utils/filename.ts:149](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/filename.ts#L149)
@@ -22,4 +22,4 @@
22
22
 
23
23
  ## Defined in
24
24
 
25
- [packages/ai-tool/src/utils/config.ts:85](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/config.ts#L85)
25
+ [packages/ai-tool/src/utils/config.ts:88](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L88)
@@ -24,4 +24,4 @@ The parameter size in bytes.
24
24
 
25
25
  ## Defined in
26
26
 
27
- [packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/convert-params-size.ts#L44)
27
+ [packages/ai-tool/src/utils/convert-params-size.ts:44](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/convert-params-size.ts#L44)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/parse-command.ts:71](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/parse-command.ts#L71)
21
+ [packages/ai-tool/src/utils/parse-command.ts:71](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/parse-command.ts#L71)
@@ -22,4 +22,4 @@
22
22
 
23
23
  ## Defined in
24
24
 
25
- [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/prompt/few-shot-prompt-template.ts#L4)
25
+ [packages/ai-tool/src/utils/prompt/few-shot-prompt-template.ts:4](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/prompt/few-shot-prompt-template.ts#L4)
@@ -34,4 +34,4 @@ console.log(splitSentence(text)); // returns ['Hello world!', 'How are you toda
34
34
 
35
35
  ## Defined in
36
36
 
37
- [packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/split-sentence.ts#L29)
37
+ [packages/ai-tool/src/utils/split-sentence.ts:29](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/split-sentence.ts#L29)
@@ -6,44 +6,16 @@
6
6
 
7
7
  # Function: stringifyYaml()
8
8
 
9
- ## stringifyYaml(value, options)
9
+ > **stringifyYaml**(`content`): `string`
10
10
 
11
- > **stringifyYaml**(`value`, `options`?): `string`
11
+ ## Parameters
12
12
 
13
- Stringify a value as a YAML document.
13
+ **content**: `any`
14
14
 
15
- ### Parameters
16
-
17
- • **value**: `any`
18
-
19
- • **options?**: `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions`
20
-
21
- ### Returns
22
-
23
- `string`
24
-
25
- Will always include `\n` as the last character, as is expected of YAML documents.
26
-
27
- ### Defined in
28
-
29
- node\_modules/.pnpm/yaml@2.5.1/node\_modules/yaml/dist/public-api.d.ts:42
30
-
31
- ## stringifyYaml(value, replacer, options)
32
-
33
- > **stringifyYaml**(`value`, `replacer`?, `options`?): `string`
34
-
35
- ### Parameters
36
-
37
- • **value**: `any`
38
-
39
- • **replacer?**: `null` \| `Replacer`
40
-
41
- • **options?**: `string` \| `number` \| `DocumentOptions` & `SchemaOptions` & `ParseOptions` & `CreateNodeOptions` & `ToStringOptions`
42
-
43
- ### Returns
15
+ ## Returns
44
16
 
45
17
  `string`
46
18
 
47
- ### Defined in
19
+ ## Defined in
48
20
 
49
- node\_modules/.pnpm/yaml@2.5.1/node\_modules/yaml/dist/public-api.d.ts:43
21
+ [packages/ai-tool/src/utils/config.ts:28](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/config.ts#L28)
@@ -20,4 +20,4 @@
20
20
 
21
21
  ## Defined in
22
22
 
23
- [packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/to-datetime.ts#L25)
23
+ [packages/ai-tool/src/utils/to-datetime.ts:25](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/to-datetime.ts#L25)
@@ -18,4 +18,4 @@
18
18
 
19
19
  ## Defined in
20
20
 
21
- [packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/to-datetime.ts#L9)
21
+ [packages/ai-tool/src/utils/to-datetime.ts:9](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/to-datetime.ts#L9)
@@ -0,0 +1,34 @@
1
+ [**@isdk/ai-tool**](../README.md) • **Docs**
2
+
3
+ ***
4
+
5
+ [@isdk/ai-tool](../globals.md) / toRegExp
6
+
7
+ # Function: toRegExp()
8
+
9
+ > **toRegExp**(`value`): `RegExp`
10
+
11
+ create or clone RegExp
12
+
13
+ ## Parameters
14
+
15
+ • **value**: `string` \| `RegExp`
16
+
17
+ create a new RegExp from.
18
+
19
+ ## Returns
20
+
21
+ `RegExp`
22
+
23
+ - new RegExp instance.
24
+
25
+ ## Example
26
+
27
+ ```ts
28
+ toRegExp('/[a-z]/g') // new RegExp(/[a-z]/g)
29
+ toRegExp(/[a-z]/g) // new RegExp(/[a-z]/g)
30
+ ```
31
+
32
+ ## Defined in
33
+
34
+ node\_modules/.pnpm/util-ex@2.0.0/node\_modules/util-ex/lib/to-regexp.d.ts:9
@@ -38,4 +38,4 @@ const output2 = trimStart(" text"); // " text"
38
38
 
39
39
  ## Defined in
40
40
 
41
- [packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/stream/ai-stream.ts#L92)
41
+ [packages/ai-tool/src/utils/stream/ai-stream.ts:92](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/stream/ai-stream.ts#L92)
@@ -44,4 +44,4 @@ truncTo(1.2345, 2, 0.6)
44
44
 
45
45
  ## Defined in
46
46
 
47
- [packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/37ada542a786fbbc770f2d61beb564f6e603941d/src/utils/trunc-to.ts#L19)
47
+ [packages/ai-tool/src/utils/trunc-to.ts:19](https://github.com/isdk/ai-tool.js/blob/fe6b47f429fb128627d2210e367fa914b891d314/src/utils/trunc-to.ts#L19)