@isdk/ai-tool 0.2.1 → 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.
- package/dist/chunk-FLVJ4R53.mjs +1 -0
- package/dist/funcs.js +1 -1
- package/dist/funcs.mjs +1 -1
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/CancelableAbility.md +20 -20
- package/docs/classes/ClientTools.md +54 -54
- package/docs/classes/EventClient.md +76 -76
- package/docs/classes/EventServer.md +78 -78
- package/docs/classes/EventToolFunc.md +46 -46
- package/docs/classes/FStringPromptTemplate.md +18 -18
- package/docs/classes/FewShotPromptTemplate.md +22 -22
- package/docs/classes/GolangPromptTemplate.md +18 -18
- package/docs/classes/HFEnvironment.md +9 -9
- package/docs/classes/HFInterpreter.md +4 -4
- package/docs/classes/HFTemplate.md +4 -4
- package/docs/classes/HfPromptTemplate.md +18 -18
- package/docs/classes/IntSet.md +11 -11
- package/docs/classes/PromptExampleSelector.md +8 -8
- package/docs/classes/PromptTemplate.md +17 -17
- package/docs/classes/ReadableStreamError.md +1 -1
- package/docs/classes/ResClientTools.md +61 -61
- package/docs/classes/ResServerTools.md +62 -62
- package/docs/classes/SSEChannel.md +14 -14
- package/docs/classes/Semaphore.md +8 -8
- package/docs/classes/ServerTools.md +50 -50
- package/docs/classes/TaskAbortController.md +7 -7
- package/docs/classes/ToolFunc.md +43 -43
- package/docs/enumerations/AsyncFeatureBits.md +3 -3
- package/docs/enumerations/AsyncFeatures.md +3 -3
- package/docs/enumerations/XXHashAlgorithm.md +2 -2
- package/docs/functions/AIArgProcessor.md +1 -1
- package/docs/functions/AIStream.md +1 -1
- package/docs/functions/ChoiceArgProcessor.md +1 -1
- package/docs/functions/RateLimit.md +1 -1
- package/docs/functions/TemplateArgProcessor.md +1 -1
- package/docs/functions/backendEventable.md +1 -1
- package/docs/functions/countRegexMatches.md +1 -1
- package/docs/functions/createCallbacksTransformer.md +1 -1
- package/docs/functions/createEmptyReadableStream.md +1 -1
- package/docs/functions/createEndWithRepetitionDetector.md +1 -1
- package/docs/functions/createEventStreamTransformer.md +1 -1
- package/docs/functions/createHfValueFunc.md +1 -1
- package/docs/functions/createLRUCache.md +1 -1
- package/docs/functions/dateToText.md +1 -1
- package/docs/functions/expandEnv.md +1 -1
- package/docs/functions/expandObjEnv.md +1 -1
- package/docs/functions/extNameLevel.md +1 -1
- package/docs/functions/fileIsExists.md +1 -1
- package/docs/functions/filenameReservedRegex.md +1 -1
- package/docs/functions/filterValidFnScope.md +1 -1
- package/docs/functions/findPort.md +1 -1
- package/docs/functions/getAllEnumKeys.md +1 -1
- package/docs/functions/getConfigFileNames.md +1 -1
- package/docs/functions/getConfigs.md +1 -1
- package/docs/functions/getKeysPath.md +1 -1
- package/docs/functions/getMultiLevelExtname.md +1 -1
- package/docs/functions/getPackageDir.md +1 -1
- package/docs/functions/getRealFilepath.md +1 -1
- package/docs/functions/getResponseErrorReadableStream.md +1 -1
- package/docs/functions/hasDirectoryIn.md +38 -0
- package/docs/functions/hfParse.md +1 -1
- package/docs/functions/hfTokenize.md +1 -1
- package/docs/functions/interpolateEnv.md +1 -1
- package/docs/functions/interpolateFString.md +1 -1
- package/docs/functions/interpolateGolangTemplate.md +1 -1
- package/docs/functions/isModelNameMatched.md +1 -1
- package/docs/functions/isRegExp.md +21 -0
- package/docs/functions/isSubdirectory.md +39 -0
- package/docs/functions/isValidFilename.md +1 -1
- package/docs/functions/isValidFilepath.md +1 -1
- package/docs/functions/isWebStream.md +1 -1
- package/docs/functions/jsonFilterToWhere.md +1 -1
- package/docs/functions/jsonToMarkdownStr.md +1 -1
- package/docs/functions/loadFileFromPaths.md +1 -1
- package/docs/functions/loadTextFromPaths.md +1 -1
- package/docs/functions/lrucache.md +1 -1
- package/docs/functions/makeToolFuncCancelable.md +1 -1
- package/docs/functions/matchUrlProtocol.md +1 -1
- package/docs/functions/memoize.md +1 -1
- package/docs/functions/messagesToText.md +1 -1
- package/docs/functions/paramsSizeToScaleStr.md +1 -1
- package/docs/functions/parseCommand.md +1 -1
- package/docs/functions/parseFString.md +1 -1
- package/docs/functions/parseJsJson.md +1 -1
- package/docs/functions/parseObjectArgInfo.md +1 -1
- package/docs/functions/parseObjectArgumentInfos.md +1 -1
- package/docs/functions/parseObjectArguments.md +1 -1
- package/docs/functions/parseObjectArgumentsAsArgInfos.md +1 -1
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/quoteStr.md +1 -1
- package/docs/functions/reControlCharsRegex.md +1 -1
- package/docs/functions/readFilenamesRecursiveSync.md +1 -1
- package/docs/functions/readableFromAsyncIterable.md +1 -1
- package/docs/functions/registerCoreTools.md +1 -1
- package/docs/functions/registerYamlTag.md +1 -1
- package/docs/functions/sanitizeFilename.md +1 -1
- package/docs/functions/sanitizeFilepath.md +1 -1
- package/docs/functions/saveConfigFile.md +1 -1
- package/docs/functions/scaleStrToParamsSize.md +1 -1
- package/docs/functions/simplifyObjectArguments.md +1 -1
- package/docs/functions/sortedValues.md +1 -1
- package/docs/functions/splitSentence.md +1 -1
- package/docs/functions/stringifyYaml.md +6 -34
- package/docs/functions/textToDate.md +1 -1
- package/docs/functions/toDateTime.md +1 -1
- package/docs/functions/toRegExp.md +34 -0
- package/docs/functions/trimStartOfStreamHelper.md +1 -1
- package/docs/functions/truncTo.md +1 -1
- package/docs/functions/uuid.md +1 -1
- package/docs/functions/wait.md +1 -1
- package/docs/functions/xxhash.md +1 -1
- package/docs/functions/xxhash32.md +1 -1
- package/docs/functions/xxhash64.md +1 -1
- package/docs/functions/xxhashAsStr.md +1 -1
- package/docs/globals.md +4 -0
- package/docs/interfaces/AIChatAssistantMessageParam.md +6 -6
- package/docs/interfaces/AIChatContentPartImage.md +2 -2
- package/docs/interfaces/AIChatContentPartText.md +2 -2
- package/docs/interfaces/AIChatMessageParamBase.md +1 -1
- package/docs/interfaces/AIChatMessageToolCall.md +3 -3
- package/docs/interfaces/AIChatSystemMessageParam.md +3 -3
- package/docs/interfaces/AIChatToolMessageParam.md +4 -4
- package/docs/interfaces/AIChatUserMessageParam.md +7 -7
- package/docs/interfaces/AIChoiceConfig.md +7 -7
- package/docs/interfaces/AIResult.md +10 -6
- package/docs/interfaces/AIStreamParser.md +1 -1
- package/docs/interfaces/AIStreamParserOptions.md +1 -1
- package/docs/interfaces/BaseFunc.md +9 -9
- package/docs/interfaces/BaseFuncItem.md +8 -8
- package/docs/interfaces/CancelableAbilityOptions.md +2 -2
- package/docs/interfaces/ClientFuncItem.md +11 -11
- package/docs/interfaces/DotenvExpandOptions.md +3 -3
- package/docs/interfaces/DotenvExpandOutput.md +2 -2
- package/docs/interfaces/EventClientFuncParams.md +4 -4
- package/docs/interfaces/EventServerFuncParams.md +5 -5
- package/docs/interfaces/FewShotPromptTemplateOptions.md +11 -11
- package/docs/interfaces/FuncItem.md +9 -9
- package/docs/interfaces/FuncParam.md +6 -6
- package/docs/interfaces/ParseObjectArgumentOptions.md +5 -5
- package/docs/interfaces/PromptExampleSelectorOptions.md +2 -2
- package/docs/interfaces/PromptTemplateOptions.md +6 -6
- package/docs/interfaces/RemoteFuncItem.md +11 -11
- package/docs/interfaces/ResClientFuncParams.md +2 -2
- package/docs/interfaces/ResServerFuncParams.md +5 -5
- package/docs/interfaces/SanitizeFilenameOptions.md +2 -2
- package/docs/interfaces/ServerFuncItem.md +12 -12
- package/docs/interfaces/ServerFuncParams.md +2 -2
- package/docs/interfaces/StreamCallbacksAndOptions.md +4 -4
- package/docs/interfaces/TaskPromise.md +1 -1
- package/docs/interfaces/ToolFuncPackage.md +3 -3
- package/docs/type-aliases/AIChatContentPart.md +1 -1
- package/docs/type-aliases/AIChatMessageParam.md +1 -1
- package/docs/type-aliases/AIChatRole.md +1 -1
- package/docs/type-aliases/AIMessageType.md +1 -1
- package/docs/type-aliases/AIModelNameRule.md +1 -1
- package/docs/type-aliases/AIModelNameRuleFn.md +1 -1
- package/docs/type-aliases/AIModelNameRules.md +1 -1
- package/docs/type-aliases/AITextGenerationFinishReason.md +1 -1
- package/docs/type-aliases/ActionName.md +1 -1
- package/docs/type-aliases/AsyncTaskId.md +1 -1
- package/docs/type-aliases/EventErrorListenerFn.md +1 -1
- package/docs/type-aliases/EventListenerFn.md +1 -1
- package/docs/type-aliases/FStringPromptTemplateNode.md +1 -1
- package/docs/type-aliases/FuncParamType.md +1 -1
- package/docs/type-aliases/PromptExamples.md +1 -1
- package/docs/type-aliases/PromptTemplateType.md +1 -1
- package/docs/type-aliases/PromptType.md +1 -1
- package/docs/type-aliases/TFunc.md +1 -1
- package/docs/variables/AIChatRoles.md +1 -1
- package/docs/variables/AIMessageTypes.md +1 -1
- package/docs/variables/AITextGenerationFinishReasons.md +2 -2
- package/docs/variables/ActionNames.md +1 -1
- package/docs/variables/ClientToolFuncSchema.md +1 -1
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/variables/EventBusName.md +1 -1
- package/docs/variables/EventName.md +1 -1
- package/docs/variables/FilenameReservedRegex.md +1 -1
- package/docs/variables/HFBuiltins.md +1 -1
- package/docs/variables/PASSING_SCORE.md +1 -1
- package/docs/variables/PromptTemplateTypes.md +1 -1
- package/docs/variables/PromptTypes.md +1 -1
- package/docs/variables/RStreamErrCode.md +1 -1
- package/docs/variables/RemoteToolFuncSchema.md +1 -1
- package/docs/variables/ResponseRStreamErrCode.md +1 -1
- package/docs/variables/SSEChannelAlreadyClosedErrCode.md +1 -1
- package/docs/variables/ServerToolFuncSchema.md +1 -1
- package/docs/variables/ToolAsyncCancelableBit.md +1 -1
- package/docs/variables/ToolAsyncMultiTaskBit.md +1 -1
- package/docs/variables/ToolAsyncPriorityBit.md +1 -1
- package/docs/variables/ToolFuncSchema.md +1 -1
- package/docs/variables/WindowsReservedNameRegex.md +1 -1
- package/docs/variables/base32768.md +1 -1
- package/docs/variables/defaultTemplateFormat.md +1 -1
- package/docs/variables/event.md +1 -1
- package/docs/variables/eventClient.md +1 -1
- package/docs/variables/eventServer.md +1 -1
- package/docs/variables/lrucache.md +1 -1
- package/package.json +1 -1
- package/dist/chunk-TOUPOZHH.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/
|
|
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/
|
|
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/
|
|
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/
|
|
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:
|
|
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:
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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:
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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:
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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:
|
|
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/
|
|
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/
|
|
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:
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
|
|
9
|
+
> **stringifyYaml**(`content`): `string`
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Parameters
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
• **content**: `any`
|
|
14
14
|
|
|
15
|
-
|
|
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
|
-
|
|
19
|
+
## Defined in
|
|
48
20
|
|
|
49
|
-
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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)
|