langsmith 0.1.35 → 0.1.36

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 (48) hide show
  1. package/dist/anonymizer/index.cjs +2 -2
  2. package/dist/anonymizer/index.js +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/utils/lodash/assignValue.cjs +29 -0
  7. package/dist/utils/lodash/assignValue.d.ts +10 -0
  8. package/dist/utils/lodash/assignValue.js +24 -0
  9. package/dist/utils/lodash/baseAssignValue.cjs +25 -0
  10. package/dist/utils/lodash/baseAssignValue.d.ts +11 -0
  11. package/dist/utils/lodash/baseAssignValue.js +23 -0
  12. package/dist/utils/lodash/baseSet.cjs +50 -0
  13. package/dist/utils/lodash/baseSet.d.ts +12 -0
  14. package/dist/utils/lodash/baseSet.js +45 -0
  15. package/dist/utils/lodash/castPath.cjs +22 -0
  16. package/dist/utils/lodash/castPath.d.ts +10 -0
  17. package/dist/utils/lodash/castPath.js +17 -0
  18. package/dist/utils/lodash/eq.cjs +36 -0
  19. package/dist/utils/lodash/eq.d.ts +32 -0
  20. package/dist/utils/lodash/eq.js +34 -0
  21. package/dist/utils/lodash/getTag.cjs +18 -0
  22. package/dist/utils/lodash/getTag.d.ts +9 -0
  23. package/dist/utils/lodash/getTag.js +16 -0
  24. package/dist/utils/lodash/isIndex.cjs +25 -0
  25. package/dist/utils/lodash/isIndex.d.ts +10 -0
  26. package/dist/utils/lodash/isIndex.js +23 -0
  27. package/dist/utils/lodash/isKey.cjs +34 -0
  28. package/dist/utils/lodash/isKey.d.ts +10 -0
  29. package/dist/utils/lodash/isKey.js +29 -0
  30. package/dist/utils/lodash/isObject.cjs +31 -0
  31. package/dist/utils/lodash/isObject.d.ts +25 -0
  32. package/dist/utils/lodash/isObject.js +29 -0
  33. package/dist/utils/lodash/isSymbol.cjs +28 -0
  34. package/dist/utils/lodash/isSymbol.d.ts +17 -0
  35. package/dist/utils/lodash/isSymbol.js +23 -0
  36. package/dist/utils/lodash/memoizeCapped.cjs +65 -0
  37. package/dist/utils/lodash/memoizeCapped.d.ts +50 -0
  38. package/dist/utils/lodash/memoizeCapped.js +63 -0
  39. package/dist/utils/lodash/set.cjs +41 -0
  40. package/dist/utils/lodash/set.d.ts +32 -0
  41. package/dist/utils/lodash/set.js +36 -0
  42. package/dist/utils/lodash/stringToPath.cjs +49 -0
  43. package/dist/utils/lodash/stringToPath.d.ts +12 -0
  44. package/dist/utils/lodash/stringToPath.js +44 -0
  45. package/dist/utils/lodash/toKey.cjs +24 -0
  46. package/dist/utils/lodash/toKey.d.ts +9 -0
  47. package/dist/utils/lodash/toKey.js +19 -0
  48. package/package.json +1 -3
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createAnonymizer = void 0;
7
- const lodash_set_1 = __importDefault(require("lodash.set"));
7
+ const set_js_1 = __importDefault(require("../utils/lodash/set.cjs"));
8
8
  function extractStringNodes(data, options) {
9
9
  const parsedOptions = { ...options, maxDepth: options.maxDepth ?? 10 };
10
10
  const queue = [
@@ -93,7 +93,7 @@ function createAnonymizer(replacer, options) {
93
93
  mutateValue = node.value;
94
94
  }
95
95
  else {
96
- (0, lodash_set_1.default)(mutateValue, node.path, node.value);
96
+ (0, set_js_1.default)(mutateValue, node.path, node.value);
97
97
  }
98
98
  }
99
99
  return mutateValue;
@@ -1,4 +1,4 @@
1
- import set from "lodash.set";
1
+ import set from "../utils/lodash/set.js";
2
2
  function extractStringNodes(data, options) {
3
3
  const parsedOptions = { ...options, maxDepth: options.maxDepth ?? 10 };
4
4
  const queue = [
package/dist/index.cjs CHANGED
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "Client", { enumerable: true, get: function () {
6
6
  var run_trees_js_1 = require("./run_trees.cjs");
7
7
  Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () { return run_trees_js_1.RunTree; } });
8
8
  // Update using yarn bump-version
9
- exports.__version__ = "0.1.35";
9
+ exports.__version__ = "0.1.36";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Client } from "./client.js";
2
2
  export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
3
3
  export { RunTree, type RunTreeConfig } from "./run_trees.js";
4
- export declare const __version__ = "0.1.35";
4
+ export declare const __version__ = "0.1.36";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Client } from "./client.js";
2
2
  export { RunTree } from "./run_trees.js";
3
3
  // Update using yarn bump-version
4
- export const __version__ = "0.1.35";
4
+ export const __version__ = "0.1.36";
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const baseAssignValue_js_1 = __importDefault(require("./baseAssignValue.cjs"));
7
+ const eq_js_1 = __importDefault(require("./eq.cjs"));
8
+ /** Used to check objects for own properties. */
9
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
10
+ /**
11
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent.
12
+ *
13
+ * @private
14
+ * @param {Object} object The object to modify.
15
+ * @param {string} key The key of the property to assign.
16
+ * @param {*} value The value to assign.
17
+ */
18
+ function assignValue(object, key, value) {
19
+ const objValue = object[key];
20
+ if (!(hasOwnProperty.call(object, key) && (0, eq_js_1.default)(objValue, value))) {
21
+ if (value !== 0 || 1 / value === 1 / objValue) {
22
+ (0, baseAssignValue_js_1.default)(object, key, value);
23
+ }
24
+ }
25
+ else if (value === undefined && !(key in object)) {
26
+ (0, baseAssignValue_js_1.default)(object, key, value);
27
+ }
28
+ }
29
+ exports.default = assignValue;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent.
3
+ *
4
+ * @private
5
+ * @param {Object} object The object to modify.
6
+ * @param {string} key The key of the property to assign.
7
+ * @param {*} value The value to assign.
8
+ */
9
+ declare function assignValue(object: Record<string, any>, key: string, value: any): void;
10
+ export default assignValue;
@@ -0,0 +1,24 @@
1
+ import baseAssignValue from "./baseAssignValue.js";
2
+ import eq from "./eq.js";
3
+ /** Used to check objects for own properties. */
4
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
5
+ /**
6
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent.
7
+ *
8
+ * @private
9
+ * @param {Object} object The object to modify.
10
+ * @param {string} key The key of the property to assign.
11
+ * @param {*} value The value to assign.
12
+ */
13
+ function assignValue(object, key, value) {
14
+ const objValue = object[key];
15
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value))) {
16
+ if (value !== 0 || 1 / value === 1 / objValue) {
17
+ baseAssignValue(object, key, value);
18
+ }
19
+ }
20
+ else if (value === undefined && !(key in object)) {
21
+ baseAssignValue(object, key, value);
22
+ }
23
+ }
24
+ export default assignValue;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * The base implementation of `assignValue` and `assignMergeValue` without
5
+ * value checks.
6
+ *
7
+ * @private
8
+ * @param {Object} object The object to modify.
9
+ * @param {string} key The key of the property to assign.
10
+ * @param {*} value The value to assign.
11
+ */
12
+ function baseAssignValue(object, key, value) {
13
+ if (key === "__proto__") {
14
+ Object.defineProperty(object, key, {
15
+ configurable: true,
16
+ enumerable: true,
17
+ value: value,
18
+ writable: true,
19
+ });
20
+ }
21
+ else {
22
+ object[key] = value;
23
+ }
24
+ }
25
+ exports.default = baseAssignValue;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The base implementation of `assignValue` and `assignMergeValue` without
3
+ * value checks.
4
+ *
5
+ * @private
6
+ * @param {Object} object The object to modify.
7
+ * @param {string} key The key of the property to assign.
8
+ * @param {*} value The value to assign.
9
+ */
10
+ declare function baseAssignValue(object: Record<string, any>, key: string, value: any): void;
11
+ export default baseAssignValue;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The base implementation of `assignValue` and `assignMergeValue` without
3
+ * value checks.
4
+ *
5
+ * @private
6
+ * @param {Object} object The object to modify.
7
+ * @param {string} key The key of the property to assign.
8
+ * @param {*} value The value to assign.
9
+ */
10
+ function baseAssignValue(object, key, value) {
11
+ if (key === "__proto__") {
12
+ Object.defineProperty(object, key, {
13
+ configurable: true,
14
+ enumerable: true,
15
+ value: value,
16
+ writable: true,
17
+ });
18
+ }
19
+ else {
20
+ object[key] = value;
21
+ }
22
+ }
23
+ export default baseAssignValue;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const assignValue_js_1 = __importDefault(require("./assignValue.cjs"));
8
+ const castPath_js_1 = __importDefault(require("./castPath.cjs"));
9
+ const isIndex_js_1 = __importDefault(require("./isIndex.cjs"));
10
+ const isObject_js_1 = __importDefault(require("./isObject.cjs"));
11
+ const toKey_js_1 = __importDefault(require("./toKey.cjs"));
12
+ /**
13
+ * The base implementation of `set`.
14
+ *
15
+ * @private
16
+ * @param {Object} object The object to modify.
17
+ * @param {Array|string} path The path of the property to set.
18
+ * @param {*} value The value to set.
19
+ * @param {Function} [customizer] The function to customize path creation.
20
+ * @returns {Object} Returns `object`.
21
+ */
22
+ function baseSet(object, path, value, customizer) {
23
+ if (!(0, isObject_js_1.default)(object)) {
24
+ return object;
25
+ }
26
+ path = (0, castPath_js_1.default)(path, object);
27
+ const length = path.length;
28
+ const lastIndex = length - 1;
29
+ let index = -1;
30
+ let nested = object;
31
+ while (nested != null && ++index < length) {
32
+ const key = (0, toKey_js_1.default)(path[index]);
33
+ let newValue = value;
34
+ if (index !== lastIndex) {
35
+ const objValue = nested[key];
36
+ newValue = customizer ? customizer(objValue, key, nested) : undefined;
37
+ if (newValue === undefined) {
38
+ newValue = (0, isObject_js_1.default)(objValue)
39
+ ? objValue
40
+ : (0, isIndex_js_1.default)(path[index + 1])
41
+ ? []
42
+ : {};
43
+ }
44
+ }
45
+ (0, assignValue_js_1.default)(nested, key, newValue);
46
+ nested = nested[key];
47
+ }
48
+ return object;
49
+ }
50
+ exports.default = baseSet;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The base implementation of `set`.
3
+ *
4
+ * @private
5
+ * @param {Object} object The object to modify.
6
+ * @param {Array|string} path The path of the property to set.
7
+ * @param {*} value The value to set.
8
+ * @param {Function} [customizer] The function to customize path creation.
9
+ * @returns {Object} Returns `object`.
10
+ */
11
+ declare function baseSet(object: any, path: any, value: any, customizer: any): any;
12
+ export default baseSet;
@@ -0,0 +1,45 @@
1
+ // @ts-nocheck
2
+ import assignValue from "./assignValue.js";
3
+ import castPath from "./castPath.js";
4
+ import isIndex from "./isIndex.js";
5
+ import isObject from "./isObject.js";
6
+ import toKey from "./toKey.js";
7
+ /**
8
+ * The base implementation of `set`.
9
+ *
10
+ * @private
11
+ * @param {Object} object The object to modify.
12
+ * @param {Array|string} path The path of the property to set.
13
+ * @param {*} value The value to set.
14
+ * @param {Function} [customizer] The function to customize path creation.
15
+ * @returns {Object} Returns `object`.
16
+ */
17
+ function baseSet(object, path, value, customizer) {
18
+ if (!isObject(object)) {
19
+ return object;
20
+ }
21
+ path = castPath(path, object);
22
+ const length = path.length;
23
+ const lastIndex = length - 1;
24
+ let index = -1;
25
+ let nested = object;
26
+ while (nested != null && ++index < length) {
27
+ const key = toKey(path[index]);
28
+ let newValue = value;
29
+ if (index !== lastIndex) {
30
+ const objValue = nested[key];
31
+ newValue = customizer ? customizer(objValue, key, nested) : undefined;
32
+ if (newValue === undefined) {
33
+ newValue = isObject(objValue)
34
+ ? objValue
35
+ : isIndex(path[index + 1])
36
+ ? []
37
+ : {};
38
+ }
39
+ }
40
+ assignValue(nested, key, newValue);
41
+ nested = nested[key];
42
+ }
43
+ return object;
44
+ }
45
+ export default baseSet;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const isKey_js_1 = __importDefault(require("./isKey.cjs"));
7
+ const stringToPath_js_1 = __importDefault(require("./stringToPath.cjs"));
8
+ /**
9
+ * Casts `value` to a path array if it's not one.
10
+ *
11
+ * @private
12
+ * @param {*} value The value to inspect.
13
+ * @param {Object} [object] The object to query keys on.
14
+ * @returns {Array} Returns the cast property path array.
15
+ */
16
+ function castPath(value, object) {
17
+ if (Array.isArray(value)) {
18
+ return value;
19
+ }
20
+ return (0, isKey_js_1.default)(value, object) ? [value] : (0, stringToPath_js_1.default)(value);
21
+ }
22
+ exports.default = castPath;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Casts `value` to a path array if it's not one.
3
+ *
4
+ * @private
5
+ * @param {*} value The value to inspect.
6
+ * @param {Object} [object] The object to query keys on.
7
+ * @returns {Array} Returns the cast property path array.
8
+ */
9
+ declare function castPath(value: any, object: Record<string, any>): any;
10
+ export default castPath;
@@ -0,0 +1,17 @@
1
+ import isKey from "./isKey.js";
2
+ import stringToPath from "./stringToPath.js";
3
+ /**
4
+ * Casts `value` to a path array if it's not one.
5
+ *
6
+ * @private
7
+ * @param {*} value The value to inspect.
8
+ * @param {Object} [object] The object to query keys on.
9
+ * @returns {Array} Returns the cast property path array.
10
+ */
11
+ function castPath(value, object) {
12
+ if (Array.isArray(value)) {
13
+ return value;
14
+ }
15
+ return isKey(value, object) ? [value] : stringToPath(value);
16
+ }
17
+ export default castPath;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Performs a
5
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
6
+ * comparison between two values to determine if they are equivalent.
7
+ *
8
+ * @since 4.0.0
9
+ * @category Lang
10
+ * @param {*} value The value to compare.
11
+ * @param {*} other The other value to compare.
12
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
13
+ * @example
14
+ *
15
+ * const object = { 'a': 1 }
16
+ * const other = { 'a': 1 }
17
+ *
18
+ * eq(object, object)
19
+ * // => true
20
+ *
21
+ * eq(object, other)
22
+ * // => false
23
+ *
24
+ * eq('a', 'a')
25
+ * // => true
26
+ *
27
+ * eq('a', Object('a'))
28
+ * // => false
29
+ *
30
+ * eq(NaN, NaN)
31
+ * // => true
32
+ */
33
+ function eq(value, other) {
34
+ return value === other || (value !== value && other !== other);
35
+ }
36
+ exports.default = eq;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Performs a
3
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4
+ * comparison between two values to determine if they are equivalent.
5
+ *
6
+ * @since 4.0.0
7
+ * @category Lang
8
+ * @param {*} value The value to compare.
9
+ * @param {*} other The other value to compare.
10
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
11
+ * @example
12
+ *
13
+ * const object = { 'a': 1 }
14
+ * const other = { 'a': 1 }
15
+ *
16
+ * eq(object, object)
17
+ * // => true
18
+ *
19
+ * eq(object, other)
20
+ * // => false
21
+ *
22
+ * eq('a', 'a')
23
+ * // => true
24
+ *
25
+ * eq('a', Object('a'))
26
+ * // => false
27
+ *
28
+ * eq(NaN, NaN)
29
+ * // => true
30
+ */
31
+ declare function eq(value: any, other: any): boolean;
32
+ export default eq;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Performs a
3
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
4
+ * comparison between two values to determine if they are equivalent.
5
+ *
6
+ * @since 4.0.0
7
+ * @category Lang
8
+ * @param {*} value The value to compare.
9
+ * @param {*} other The other value to compare.
10
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
11
+ * @example
12
+ *
13
+ * const object = { 'a': 1 }
14
+ * const other = { 'a': 1 }
15
+ *
16
+ * eq(object, object)
17
+ * // => true
18
+ *
19
+ * eq(object, other)
20
+ * // => false
21
+ *
22
+ * eq('a', 'a')
23
+ * // => true
24
+ *
25
+ * eq('a', Object('a'))
26
+ * // => false
27
+ *
28
+ * eq(NaN, NaN)
29
+ * // => true
30
+ */
31
+ function eq(value, other) {
32
+ return value === other || (value !== value && other !== other);
33
+ }
34
+ export default eq;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const toString = Object.prototype.toString;
5
+ /**
6
+ * Gets the `toStringTag` of `value`.
7
+ *
8
+ * @private
9
+ * @param {*} value The value to query.
10
+ * @returns {string} Returns the `toStringTag`.
11
+ */
12
+ function getTag(value) {
13
+ if (value == null) {
14
+ return value === undefined ? "[object Undefined]" : "[object Null]";
15
+ }
16
+ return toString.call(value);
17
+ }
18
+ exports.default = getTag;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gets the `toStringTag` of `value`.
3
+ *
4
+ * @private
5
+ * @param {*} value The value to query.
6
+ * @returns {string} Returns the `toStringTag`.
7
+ */
8
+ declare function getTag(value: any): string;
9
+ export default getTag;
@@ -0,0 +1,16 @@
1
+ // @ts-nocheck
2
+ const toString = Object.prototype.toString;
3
+ /**
4
+ * Gets the `toStringTag` of `value`.
5
+ *
6
+ * @private
7
+ * @param {*} value The value to query.
8
+ * @returns {string} Returns the `toStringTag`.
9
+ */
10
+ function getTag(value) {
11
+ if (value == null) {
12
+ return value === undefined ? "[object Undefined]" : "[object Null]";
13
+ }
14
+ return toString.call(value);
15
+ }
16
+ export default getTag;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /** Used as references for various `Number` constants. */
5
+ const MAX_SAFE_INTEGER = 9007199254740991;
6
+ /** Used to detect unsigned integer values. */
7
+ const reIsUint = /^(?:0|[1-9]\d*)$/;
8
+ /**
9
+ * Checks if `value` is a valid array-like index.
10
+ *
11
+ * @private
12
+ * @param {*} value The value to check.
13
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
14
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
15
+ */
16
+ function isIndex(value, length) {
17
+ const type = typeof value;
18
+ length = length == null ? MAX_SAFE_INTEGER : length;
19
+ return (!!length &&
20
+ (type === "number" || (type !== "symbol" && reIsUint.test(value))) &&
21
+ value > -1 &&
22
+ value % 1 === 0 &&
23
+ value < length);
24
+ }
25
+ exports.default = isIndex;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Checks if `value` is a valid array-like index.
3
+ *
4
+ * @private
5
+ * @param {*} value The value to check.
6
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
7
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
8
+ */
9
+ declare function isIndex(value: any, length: any): boolean;
10
+ export default isIndex;
@@ -0,0 +1,23 @@
1
+ // @ts-nocheck
2
+ /** Used as references for various `Number` constants. */
3
+ const MAX_SAFE_INTEGER = 9007199254740991;
4
+ /** Used to detect unsigned integer values. */
5
+ const reIsUint = /^(?:0|[1-9]\d*)$/;
6
+ /**
7
+ * Checks if `value` is a valid array-like index.
8
+ *
9
+ * @private
10
+ * @param {*} value The value to check.
11
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
12
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
13
+ */
14
+ function isIndex(value, length) {
15
+ const type = typeof value;
16
+ length = length == null ? MAX_SAFE_INTEGER : length;
17
+ return (!!length &&
18
+ (type === "number" || (type !== "symbol" && reIsUint.test(value))) &&
19
+ value > -1 &&
20
+ value % 1 === 0 &&
21
+ value < length);
22
+ }
23
+ export default isIndex;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ // @ts-nocheck
7
+ const isSymbol_js_1 = __importDefault(require("./isSymbol.cjs"));
8
+ /** Used to match property names within property paths. */
9
+ const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
10
+ const reIsPlainProp = /^\w*$/;
11
+ /**
12
+ * Checks if `value` is a property name and not a property path.
13
+ *
14
+ * @private
15
+ * @param {*} value The value to check.
16
+ * @param {Object} [object] The object to query keys on.
17
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
18
+ */
19
+ function isKey(value, object) {
20
+ if (Array.isArray(value)) {
21
+ return false;
22
+ }
23
+ const type = typeof value;
24
+ if (type === "number" ||
25
+ type === "boolean" ||
26
+ value == null ||
27
+ (0, isSymbol_js_1.default)(value)) {
28
+ return true;
29
+ }
30
+ return (reIsPlainProp.test(value) ||
31
+ !reIsDeepProp.test(value) ||
32
+ (object != null && value in Object(object)));
33
+ }
34
+ exports.default = isKey;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Checks if `value` is a property name and not a property path.
3
+ *
4
+ * @private
5
+ * @param {*} value The value to check.
6
+ * @param {Object} [object] The object to query keys on.
7
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
8
+ */
9
+ declare function isKey(value: any, object: any): boolean;
10
+ export default isKey;
@@ -0,0 +1,29 @@
1
+ // @ts-nocheck
2
+ import isSymbol from "./isSymbol.js";
3
+ /** Used to match property names within property paths. */
4
+ const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
5
+ const reIsPlainProp = /^\w*$/;
6
+ /**
7
+ * Checks if `value` is a property name and not a property path.
8
+ *
9
+ * @private
10
+ * @param {*} value The value to check.
11
+ * @param {Object} [object] The object to query keys on.
12
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
13
+ */
14
+ function isKey(value, object) {
15
+ if (Array.isArray(value)) {
16
+ return false;
17
+ }
18
+ const type = typeof value;
19
+ if (type === "number" ||
20
+ type === "boolean" ||
21
+ value == null ||
22
+ isSymbol(value)) {
23
+ return true;
24
+ }
25
+ return (reIsPlainProp.test(value) ||
26
+ !reIsDeepProp.test(value) ||
27
+ (object != null && value in Object(object)));
28
+ }
29
+ export default isKey;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Checks if `value` is the
6
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
7
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
8
+ *
9
+ * @since 0.1.0
10
+ * @category Lang
11
+ * @param {*} value The value to check.
12
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
13
+ * @example
14
+ *
15
+ * isObject({})
16
+ * // => true
17
+ *
18
+ * isObject([1, 2, 3])
19
+ * // => true
20
+ *
21
+ * isObject(Function)
22
+ * // => true
23
+ *
24
+ * isObject(null)
25
+ * // => false
26
+ */
27
+ function isObject(value) {
28
+ const type = typeof value;
29
+ return value != null && (type === "object" || type === "function");
30
+ }
31
+ exports.default = isObject;