langsmith 0.1.35 → 0.1.37

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 (51) hide show
  1. package/dist/anonymizer/index.cjs +2 -2
  2. package/dist/anonymizer/index.js +1 -1
  3. package/dist/client.cjs +61 -0
  4. package/dist/client.d.ts +12 -0
  5. package/dist/client.js +61 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/utils/lodash/assignValue.cjs +29 -0
  10. package/dist/utils/lodash/assignValue.d.ts +10 -0
  11. package/dist/utils/lodash/assignValue.js +24 -0
  12. package/dist/utils/lodash/baseAssignValue.cjs +25 -0
  13. package/dist/utils/lodash/baseAssignValue.d.ts +11 -0
  14. package/dist/utils/lodash/baseAssignValue.js +23 -0
  15. package/dist/utils/lodash/baseSet.cjs +50 -0
  16. package/dist/utils/lodash/baseSet.d.ts +12 -0
  17. package/dist/utils/lodash/baseSet.js +45 -0
  18. package/dist/utils/lodash/castPath.cjs +22 -0
  19. package/dist/utils/lodash/castPath.d.ts +10 -0
  20. package/dist/utils/lodash/castPath.js +17 -0
  21. package/dist/utils/lodash/eq.cjs +36 -0
  22. package/dist/utils/lodash/eq.d.ts +32 -0
  23. package/dist/utils/lodash/eq.js +34 -0
  24. package/dist/utils/lodash/getTag.cjs +18 -0
  25. package/dist/utils/lodash/getTag.d.ts +9 -0
  26. package/dist/utils/lodash/getTag.js +16 -0
  27. package/dist/utils/lodash/isIndex.cjs +25 -0
  28. package/dist/utils/lodash/isIndex.d.ts +10 -0
  29. package/dist/utils/lodash/isIndex.js +23 -0
  30. package/dist/utils/lodash/isKey.cjs +34 -0
  31. package/dist/utils/lodash/isKey.d.ts +10 -0
  32. package/dist/utils/lodash/isKey.js +29 -0
  33. package/dist/utils/lodash/isObject.cjs +31 -0
  34. package/dist/utils/lodash/isObject.d.ts +25 -0
  35. package/dist/utils/lodash/isObject.js +29 -0
  36. package/dist/utils/lodash/isSymbol.cjs +28 -0
  37. package/dist/utils/lodash/isSymbol.d.ts +17 -0
  38. package/dist/utils/lodash/isSymbol.js +23 -0
  39. package/dist/utils/lodash/memoizeCapped.cjs +65 -0
  40. package/dist/utils/lodash/memoizeCapped.d.ts +50 -0
  41. package/dist/utils/lodash/memoizeCapped.js +63 -0
  42. package/dist/utils/lodash/set.cjs +41 -0
  43. package/dist/utils/lodash/set.d.ts +32 -0
  44. package/dist/utils/lodash/set.js +36 -0
  45. package/dist/utils/lodash/stringToPath.cjs +49 -0
  46. package/dist/utils/lodash/stringToPath.d.ts +12 -0
  47. package/dist/utils/lodash/stringToPath.js +44 -0
  48. package/dist/utils/lodash/toKey.cjs +24 -0
  49. package/dist/utils/lodash/toKey.d.ts +9 -0
  50. package/dist/utils/lodash/toKey.js +19 -0
  51. 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/client.cjs CHANGED
@@ -1659,6 +1659,67 @@ class Client {
1659
1659
  const result = await response.json();
1660
1660
  return result;
1661
1661
  }
1662
+ async listDatasetSplits({ datasetId, datasetName, asOf, }) {
1663
+ let datasetId_;
1664
+ if (datasetId === undefined && datasetName === undefined) {
1665
+ throw new Error("Must provide dataset name or ID");
1666
+ }
1667
+ else if (datasetId !== undefined && datasetName !== undefined) {
1668
+ throw new Error("Must provide either datasetName or datasetId, not both");
1669
+ }
1670
+ else if (datasetId === undefined) {
1671
+ const dataset = await this.readDataset({ datasetName });
1672
+ datasetId_ = dataset.id;
1673
+ }
1674
+ else {
1675
+ datasetId_ = datasetId;
1676
+ }
1677
+ (0, _uuid_js_1.assertUuid)(datasetId_);
1678
+ const params = new URLSearchParams();
1679
+ const dataset_version = asOf
1680
+ ? typeof asOf === "string"
1681
+ ? asOf
1682
+ : asOf?.toISOString()
1683
+ : undefined;
1684
+ if (dataset_version) {
1685
+ params.append("as_of", dataset_version);
1686
+ }
1687
+ const response = await this._get(`/datasets/${datasetId_}/splits`, params);
1688
+ return response;
1689
+ }
1690
+ async updateDatasetSplits({ datasetId, datasetName, splitName, exampleIds, remove = false, }) {
1691
+ let datasetId_;
1692
+ if (datasetId === undefined && datasetName === undefined) {
1693
+ throw new Error("Must provide dataset name or ID");
1694
+ }
1695
+ else if (datasetId !== undefined && datasetName !== undefined) {
1696
+ throw new Error("Must provide either datasetName or datasetId, not both");
1697
+ }
1698
+ else if (datasetId === undefined) {
1699
+ const dataset = await this.readDataset({ datasetName });
1700
+ datasetId_ = dataset.id;
1701
+ }
1702
+ else {
1703
+ datasetId_ = datasetId;
1704
+ }
1705
+ (0, _uuid_js_1.assertUuid)(datasetId_);
1706
+ const data = {
1707
+ split_name: splitName,
1708
+ examples: exampleIds.map((id) => {
1709
+ (0, _uuid_js_1.assertUuid)(id);
1710
+ return id;
1711
+ }),
1712
+ remove,
1713
+ };
1714
+ const response = await this.caller.call(fetch, `${this.apiUrl}/datasets/${datasetId_}/splits`, {
1715
+ method: "PUT",
1716
+ headers: { ...this.headers, "Content-Type": "application/json" },
1717
+ body: JSON.stringify(data),
1718
+ signal: AbortSignal.timeout(this.timeout_ms),
1719
+ ...this.fetchOptions,
1720
+ });
1721
+ await raiseForStatus(response, "update dataset splits");
1722
+ }
1662
1723
  /**
1663
1724
  * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
1664
1725
  */
package/dist/client.d.ts CHANGED
@@ -430,6 +430,18 @@ export declare class Client {
430
430
  }): AsyncIterable<Example>;
431
431
  deleteExample(exampleId: string): Promise<void>;
432
432
  updateExample(exampleId: string, update: ExampleUpdate): Promise<object>;
433
+ listDatasetSplits({ datasetId, datasetName, asOf, }: {
434
+ datasetId?: string;
435
+ datasetName?: string;
436
+ asOf?: string | Date;
437
+ }): Promise<string[]>;
438
+ updateDatasetSplits({ datasetId, datasetName, splitName, exampleIds, remove, }: {
439
+ datasetId?: string;
440
+ datasetName?: string;
441
+ splitName: string;
442
+ exampleIds: string[];
443
+ remove?: boolean;
444
+ }): Promise<void>;
433
445
  /**
434
446
  * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
435
447
  */
package/dist/client.js CHANGED
@@ -1632,6 +1632,67 @@ export class Client {
1632
1632
  const result = await response.json();
1633
1633
  return result;
1634
1634
  }
1635
+ async listDatasetSplits({ datasetId, datasetName, asOf, }) {
1636
+ let datasetId_;
1637
+ if (datasetId === undefined && datasetName === undefined) {
1638
+ throw new Error("Must provide dataset name or ID");
1639
+ }
1640
+ else if (datasetId !== undefined && datasetName !== undefined) {
1641
+ throw new Error("Must provide either datasetName or datasetId, not both");
1642
+ }
1643
+ else if (datasetId === undefined) {
1644
+ const dataset = await this.readDataset({ datasetName });
1645
+ datasetId_ = dataset.id;
1646
+ }
1647
+ else {
1648
+ datasetId_ = datasetId;
1649
+ }
1650
+ assertUuid(datasetId_);
1651
+ const params = new URLSearchParams();
1652
+ const dataset_version = asOf
1653
+ ? typeof asOf === "string"
1654
+ ? asOf
1655
+ : asOf?.toISOString()
1656
+ : undefined;
1657
+ if (dataset_version) {
1658
+ params.append("as_of", dataset_version);
1659
+ }
1660
+ const response = await this._get(`/datasets/${datasetId_}/splits`, params);
1661
+ return response;
1662
+ }
1663
+ async updateDatasetSplits({ datasetId, datasetName, splitName, exampleIds, remove = false, }) {
1664
+ let datasetId_;
1665
+ if (datasetId === undefined && datasetName === undefined) {
1666
+ throw new Error("Must provide dataset name or ID");
1667
+ }
1668
+ else if (datasetId !== undefined && datasetName !== undefined) {
1669
+ throw new Error("Must provide either datasetName or datasetId, not both");
1670
+ }
1671
+ else if (datasetId === undefined) {
1672
+ const dataset = await this.readDataset({ datasetName });
1673
+ datasetId_ = dataset.id;
1674
+ }
1675
+ else {
1676
+ datasetId_ = datasetId;
1677
+ }
1678
+ assertUuid(datasetId_);
1679
+ const data = {
1680
+ split_name: splitName,
1681
+ examples: exampleIds.map((id) => {
1682
+ assertUuid(id);
1683
+ return id;
1684
+ }),
1685
+ remove,
1686
+ };
1687
+ const response = await this.caller.call(fetch, `${this.apiUrl}/datasets/${datasetId_}/splits`, {
1688
+ method: "PUT",
1689
+ headers: { ...this.headers, "Content-Type": "application/json" },
1690
+ body: JSON.stringify(data),
1691
+ signal: AbortSignal.timeout(this.timeout_ms),
1692
+ ...this.fetchOptions,
1693
+ });
1694
+ await raiseForStatus(response, "update dataset splits");
1695
+ }
1635
1696
  /**
1636
1697
  * @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
1637
1698
  */
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.37";
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.37";
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.37";
@@ -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;