[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Assert](https://evolu.dev/docs/api-reference/common/Assert) › assertSame

```ts
const assertSame: <Expected>(
  actual: unknown,
  expected: Expected,
) => asserts actual is Expected;
```

Defined in: [packages/common/src/Assert.ts:1009](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Assert.ts#L1009)

Asserts that two values are the same using `Object.is`.

Use this when exact sameness is the contract, such as asserting reference
identity or narrowing the actual value to the expected value's type, as shown
below. For value comparisons, use [assertEqual](https://evolu.dev/docs/api-reference/common/Assert/functions/assertEqual).

Uses the same equality semantics as `assert.strictEqual` from
`node:assert/strict`, but is platform-agnostic. See [eqSameValue](https://evolu.dev/docs/api-reference/common/Eq/functions/eqSameValue) for
the equality semantics.

### Example

```ts

interface User {
  readonly name: string;
}

const user: User = { name: "Ada" };
const value: unknown = user;

assertSame(value, user);
// `assertSame` narrows `value` from `unknown` to `User`.
assertType<typeof value, User>();
```