@orq-ai/node 4.11.0-rc.13 → 4.11.0-rc.15
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/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/encodings.js +12 -12
- package/lib/encodings.js.map +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +3 -3
- package/lib/env.js.map +1 -1
- package/lib/matchers.js +3 -3
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +1 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +18 -0
- package/lib/primitives.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.js +16 -16
- package/models/operations/creatememorystore.d.ts +3 -3
- package/models/operations/creatememorystore.d.ts.map +1 -1
- package/models/operations/creatememorystore.js +2 -2
- package/models/operations/creatememorystore.js.map +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/getallmemorystores.d.ts +1 -1
- package/models/operations/getallmemorystores.d.ts.map +1 -1
- package/models/operations/getallmemorystores.js +1 -1
- package/models/operations/getallmemorystores.js.map +1 -1
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrievememorystore.d.ts +1 -1
- package/models/operations/retrievememorystore.d.ts.map +1 -1
- package/models/operations/retrievememorystore.js +1 -1
- package/models/operations/retrievememorystore.js.map +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +16 -16
- package/models/operations/updatememorystore.d.ts +3 -3
- package/models/operations/updatememorystore.d.ts.map +1 -1
- package/models/operations/updatememorystore.js +2 -2
- package/models/operations/updatememorystore.js.map +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +1 -1
- package/sdk/feedback.d.ts +1 -4
- package/sdk/feedback.d.ts.map +1 -1
- package/sdk/feedback.js +1 -4
- package/sdk/feedback.js.map +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +1 -1
- package/src/lib/env.ts +7 -3
- package/src/lib/matchers.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/creatememorystore.ts +5 -5
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/getallmemorystores.ts +2 -2
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrievememorystore.ts +2 -2
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +16 -16
- package/src/models/operations/updatememorystore.ts +5 -5
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/feedback.ts +1 -4
- package/lib/dlv.d.ts +0 -14
- package/lib/dlv.d.ts.map +0 -1
- package/lib/dlv.js +0 -49
- package/lib/dlv.js.map +0 -1
- package/lib/is-plain-object.d.ts +0 -2
- package/lib/is-plain-object.d.ts.map +0 -1
- package/lib/is-plain-object.js +0 -41
- package/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
|
@@ -1472,7 +1472,7 @@ export const RequestBodyTools$outboundSchema: z.ZodType<
|
|
|
1472
1472
|
z.ZodTypeDef,
|
|
1473
1473
|
RequestBodyTools
|
|
1474
1474
|
> = z.object({
|
|
1475
|
-
id: z.string().default("
|
|
1475
|
+
id: z.string().default("01KTX87DF94EY9KW1DKAWK6C96"),
|
|
1476
1476
|
name: z.string(),
|
|
1477
1477
|
description: z.string().optional(),
|
|
1478
1478
|
schema: z.lazy(() => UpdateToolRequestBodyToolsSchema$outboundSchema),
|
|
@@ -2193,7 +2193,7 @@ export const UpdateToolResponseBodyCodeExecutionTool$inboundSchema: z.ZodType<
|
|
|
2193
2193
|
z.ZodTypeDef,
|
|
2194
2194
|
unknown
|
|
2195
2195
|
> = z.object({
|
|
2196
|
-
_id: z.string().default("
|
|
2196
|
+
_id: z.string().default("tool_01KTX87DF2F5Q85AF7407618QN"),
|
|
2197
2197
|
path: z.string(),
|
|
2198
2198
|
key: z.string(),
|
|
2199
2199
|
display_name: z.string().optional(),
|
|
@@ -2296,7 +2296,7 @@ export const UpdateToolResponseBodyTools$inboundSchema: z.ZodType<
|
|
|
2296
2296
|
z.ZodTypeDef,
|
|
2297
2297
|
unknown
|
|
2298
2298
|
> = z.object({
|
|
2299
|
-
id: z.string().default("
|
|
2299
|
+
id: z.string().default("01KTX87DF0J4FP2VH2VNBGXD81"),
|
|
2300
2300
|
name: z.string(),
|
|
2301
2301
|
description: z.string().optional(),
|
|
2302
2302
|
schema: z.lazy(() => UpdateToolResponseBodyToolsSchema$inboundSchema),
|
|
@@ -2354,7 +2354,7 @@ export const UpdateToolResponseBodyMCPTool$inboundSchema: z.ZodType<
|
|
|
2354
2354
|
z.ZodTypeDef,
|
|
2355
2355
|
unknown
|
|
2356
2356
|
> = z.object({
|
|
2357
|
-
_id: z.string().default("
|
|
2357
|
+
_id: z.string().default("tool_01KTX87DEZED1EDQN26BX94PRZ"),
|
|
2358
2358
|
path: z.string(),
|
|
2359
2359
|
key: z.string(),
|
|
2360
2360
|
display_name: z.string().optional(),
|
|
@@ -2543,7 +2543,7 @@ export const UpdateToolResponseBodyHTTPTool$inboundSchema: z.ZodType<
|
|
|
2543
2543
|
z.ZodTypeDef,
|
|
2544
2544
|
unknown
|
|
2545
2545
|
> = z.object({
|
|
2546
|
-
_id: z.string().default("
|
|
2546
|
+
_id: z.string().default("tool_01KTX87DEW8ZC0W1C8KZW39B76"),
|
|
2547
2547
|
path: z.string(),
|
|
2548
2548
|
key: z.string(),
|
|
2549
2549
|
display_name: z.string().optional(),
|
|
@@ -2638,7 +2638,7 @@ export const UpdateToolResponseBodyJSONSchemaTool$inboundSchema: z.ZodType<
|
|
|
2638
2638
|
z.ZodTypeDef,
|
|
2639
2639
|
unknown
|
|
2640
2640
|
> = z.object({
|
|
2641
|
-
_id: z.string().default("
|
|
2641
|
+
_id: z.string().default("tool_01KTX87DESD7029THS1806BSP1"),
|
|
2642
2642
|
path: z.string(),
|
|
2643
2643
|
key: z.string(),
|
|
2644
2644
|
display_name: z.string().optional(),
|
|
@@ -2741,7 +2741,7 @@ export const UpdateToolResponseBodyFunctionTool$inboundSchema: z.ZodType<
|
|
|
2741
2741
|
z.ZodTypeDef,
|
|
2742
2742
|
unknown
|
|
2743
2743
|
> = z.object({
|
|
2744
|
-
_id: z.string().default("
|
|
2744
|
+
_id: z.string().default("tool_01KTX87DEQ1B358XQB1AY3KZFJ"),
|
|
2745
2745
|
path: z.string(),
|
|
2746
2746
|
key: z.string(),
|
|
2747
2747
|
display_name: z.string().optional(),
|
package/src/sdk/feedback.ts
CHANGED
|
@@ -45,10 +45,7 @@ export class Feedback extends ClientSDK {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Create
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* Creates a new dataset in the specified project.
|
|
48
|
+
* Create translation
|
|
52
49
|
*/
|
|
53
50
|
async create(
|
|
54
51
|
request?: operations.PostV2FeedbackRequestBody | undefined,
|
package/lib/dlv.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param obj The object to walk
|
|
3
|
-
* @param key The key path to walk the object with
|
|
4
|
-
* @param def A default value to return if the result is undefined
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* dlv(obj, "a.b.c.d")
|
|
8
|
-
* @example
|
|
9
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
10
|
-
* @example
|
|
11
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
12
|
-
*/
|
|
13
|
-
export declare function dlv<T = any>(obj: any, key: string | string[], def?: T, p?: number, undef?: never): T | undefined;
|
|
14
|
-
//# sourceMappingURL=dlv.d.ts.map
|
package/lib/dlv.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dlv.d.ts","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,GAAG,CAAC,EAAE,CAAC,EACP,CAAC,CAAC,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC,GAAG,SAAS,CAOf"}
|
package/lib/dlv.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.dlv = dlv;
|
|
7
|
-
/*
|
|
8
|
-
MIT License
|
|
9
|
-
|
|
10
|
-
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
11
|
-
|
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
-
the Software without restriction, including without limitation the rights to
|
|
15
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
-
subject to the following conditions:
|
|
18
|
-
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
copies or substantial portions of the Software.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
24
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
25
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @param obj The object to walk
|
|
31
|
-
* @param key The key path to walk the object with
|
|
32
|
-
* @param def A default value to return if the result is undefined
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* dlv(obj, "a.b.c.d")
|
|
36
|
-
* @example
|
|
37
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
38
|
-
* @example
|
|
39
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
40
|
-
*/
|
|
41
|
-
function dlv(obj, key, def, p, undef) {
|
|
42
|
-
key = Array.isArray(key) ? key : key.split(".");
|
|
43
|
-
for (p = 0; p < key.length; p++) {
|
|
44
|
-
const k = key[p];
|
|
45
|
-
obj = k != null && obj ? obj[k] : undef;
|
|
46
|
-
}
|
|
47
|
-
return obj === undef ? def : obj;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=dlv.js.map
|
package/lib/dlv.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dlv.js","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqCH,kBAaC;AAhDD;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF;;;;;;;;;;;GAWG;AACH,SAAgB,GAAG,CACjB,GAAQ,EACR,GAAsB,EACtB,GAAO,EACP,CAAU,EACV,KAAa;IAEb,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC"}
|
package/lib/is-plain-object.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.d.ts","sourceRoot":"","sources":["../src/lib/is-plain-object.ts"],"names":[],"mappings":"AA6BA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAa7D"}
|
package/lib/is-plain-object.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isPlainObject = isPlainObject;
|
|
7
|
-
/*
|
|
8
|
-
MIT License
|
|
9
|
-
|
|
10
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
11
|
-
|
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
-
the Software without restriction, including without limitation the rights to
|
|
15
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
-
subject to the following conditions:
|
|
18
|
-
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
copies or substantial portions of the Software.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
24
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
25
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
*/
|
|
29
|
-
// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
|
|
30
|
-
function isPlainObject(value) {
|
|
31
|
-
if (typeof value !== "object" || value === null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const prototype = Object.getPrototypeOf(value);
|
|
35
|
-
return ((prototype === null ||
|
|
36
|
-
prototype === Object.prototype ||
|
|
37
|
-
Object.getPrototypeOf(prototype) === null) &&
|
|
38
|
-
!(Symbol.toStringTag in value) &&
|
|
39
|
-
!(Symbol.iterator in value));
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=is-plain-object.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../src/lib/is-plain-object.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA2BH,sCAaC;AAtCD;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,iHAAiH;AAEjH,SAAgB,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,CACL,CAAC,SAAS,KAAK,IAAI;QACjB,SAAS,KAAK,MAAM,CAAC,SAAS;QAC9B,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;QAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
package/src/lib/dlv.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
-
the Software without restriction, including without limitation the rights to
|
|
13
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param obj The object to walk
|
|
30
|
-
* @param key The key path to walk the object with
|
|
31
|
-
* @param def A default value to return if the result is undefined
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* dlv(obj, "a.b.c.d")
|
|
35
|
-
* @example
|
|
36
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
37
|
-
* @example
|
|
38
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
39
|
-
*/
|
|
40
|
-
export function dlv<T = any>(
|
|
41
|
-
obj: any,
|
|
42
|
-
key: string | string[],
|
|
43
|
-
def?: T,
|
|
44
|
-
p?: number,
|
|
45
|
-
undef?: never,
|
|
46
|
-
): T | undefined {
|
|
47
|
-
key = Array.isArray(key) ? key : key.split(".");
|
|
48
|
-
for (p = 0; p < key.length; p++) {
|
|
49
|
-
const k = key[p];
|
|
50
|
-
obj = k != null && obj ? obj[k] : undef;
|
|
51
|
-
}
|
|
52
|
-
return obj === undef ? def : obj;
|
|
53
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
-
the Software without restriction, including without limitation the rights to
|
|
13
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
|
|
29
|
-
|
|
30
|
-
export function isPlainObject(value: unknown): value is object {
|
|
31
|
-
if (typeof value !== "object" || value === null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const prototype = Object.getPrototypeOf(value);
|
|
36
|
-
return (
|
|
37
|
-
(prototype === null ||
|
|
38
|
-
prototype === Object.prototype ||
|
|
39
|
-
Object.getPrototypeOf(prototype) === null) &&
|
|
40
|
-
!(Symbol.toStringTag in value) &&
|
|
41
|
-
!(Symbol.iterator in value)
|
|
42
|
-
);
|
|
43
|
-
}
|