dandv
dandv
DDeno
Created by dandv on 1/29/2025 in #help
Tell `deno outdated` to show patch level updates
Is there a way to tell deno outdated to show ALL updates, even those affecting only the patch level? I fI have "@std/cli": "jsr:@std/cli@^1.0.0" in deno.json, deno outdated won't say anything, even though the current version is 1.0.11. It's also unclear what version will actually be used in that case since the ^ is specified. The most recent in the cache? Does deno outdated silently update to the last patch level?
1 replies
DDeno
Created by dandv on 1/19/2025 in #help
Is assertObjectMatch too type-strict?
If you have two typed objects, actual and expect, of the same type, assertObjectMatch doesn't let you use the expect object:
import { assertObjectMatch } from '@std/assert';

interface FirstLast {
first: string
last: string
}

Deno.test('assertObjectMatch', () => {
const expected: FirstLast = {
first: 'John',
last: 'Doe',
};

const actual = expected;

// passes
assertObjectMatch(actual, {
first: 'John',
last: 'Doe',
});

// fails because `expected` is too typed now?
assertObjectMatch(actual, expected);
// Argument of type 'FirstLast' is not assignable to parameter of type 'Record<PropertyKey, unknown>'.
// Index signature for type 'string' is missing in type 'FirstLast'.

// casting is ugly:
assertObjectMatch(actual, expected as unknown as Record<PropertyKey, unknown>);
});
import { assertObjectMatch } from '@std/assert';

interface FirstLast {
first: string
last: string
}

Deno.test('assertObjectMatch', () => {
const expected: FirstLast = {
first: 'John',
last: 'Doe',
};

const actual = expected;

// passes
assertObjectMatch(actual, {
first: 'John',
last: 'Doe',
});

// fails because `expected` is too typed now?
assertObjectMatch(actual, expected);
// Argument of type 'FirstLast' is not assignable to parameter of type 'Record<PropertyKey, unknown>'.
// Index signature for type 'string' is missing in type 'FirstLast'.

// casting is ugly:
assertObjectMatch(actual, expected as unknown as Record<PropertyKey, unknown>);
});
What am I doing wrong here?
1 replies