Skip to content

Commit 668856c

Browse files
authored
fix: use with keyword for import attributes (denoland#4141)
* refactor: use `with` keyword for import attributes * fix
1 parent 4df9f27 commit 668856c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

console/unicode_width.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
22
// Ported from unicode_width rust crate, Copyright (c) 2015 The Rust Project Developers. MIT license.
33

4-
import data from "./_data.json" assert { type: "json" };
4+
import data from "./_data.json" with { type: "json" };
55
import { runLengthDecode } from "./_rle.ts";
66

77
let tables: Uint8Array[] | null = null;

html/_tools/generate_data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// JSON version of the full canonical list of named HTML entities
55
// https://html.spec.whatwg.org/multipage/named-characters.html
6-
import entityList from "https://html.spec.whatwg.org/entities.json" assert {
6+
import entityList from "https://html.spec.whatwg.org/entities.json" with {
77
type: "json",
88
};
99

html/entities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const entityListRegexCache = new WeakMap<EntityList, RegExp>();
6666
* unescape("&thorn;&eth;"); // "&thorn;&eth;"
6767
*
6868
* // Using the full named entity list from the HTML spec (~47K un-minified)
69-
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
69+
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" with { type: "json" };
7070
*
7171
* unescape("&thorn;&eth;", { entityList }); // "þð"
7272
* ```

html/entities_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { escape, unescape } from "./entities.ts";
44
import { assertEquals } from "../assert/mod.ts";
5-
import entityList from "./named_entity_list.json" assert { type: "json" };
5+
import entityList from "./named_entity_list.json" with { type: "json" };
66

77
Deno.test("escape()", async (t) => {
88
await t.step('escapes &<>"', () => {

http/user_agent_test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Deno.test({
77
name: "UserAgent.prototype.browser",
88
async fn(t) {
99
const specs = (await import("./testdata/user_agent/browser-all.json", {
10-
assert: { type: "json" },
10+
with: { type: "json" },
1111
})).default;
1212
for (const { desc, ua, expect: { major, name, version } } of specs) {
1313
await t.step({
@@ -29,7 +29,7 @@ Deno.test({
2929
name: "UserAgent.prototype.cpu",
3030
async fn(t) {
3131
const specs = (await import("./testdata/user_agent/cpu-all.json", {
32-
assert: { type: "json" },
32+
with: { type: "json" },
3333
})).default;
3434
for (const { desc: name, ua, expect } of specs) {
3535
await t.step({
@@ -47,7 +47,7 @@ Deno.test({
4747
name: "UserAgent.prototype.device",
4848
async fn(t) {
4949
const specs = (await import("./testdata/user_agent/device-all.json", {
50-
assert: { type: "json" },
50+
with: { type: "json" },
5151
})).default;
5252
for (const { desc: name, ua, expect: { vendor, model, type } } of specs) {
5353
await t.step({
@@ -69,7 +69,7 @@ Deno.test({
6969
name: "UserAgent.prototype.engine",
7070
async fn(t) {
7171
const specs = (await import("./testdata/user_agent/engine-all.json", {
72-
assert: { type: "json" },
72+
with: { type: "json" },
7373
})).default;
7474
for (const { desc, ua, expect: { name, version } } of specs) {
7575
await t.step({
@@ -90,7 +90,7 @@ Deno.test({
9090
name: "UserAgent.prototype.os",
9191
async fn(t) {
9292
const specs = (await import("./testdata/user_agent/os-all.json", {
93-
assert: { type: "json" },
93+
with: { type: "json" },
9494
})).default;
9595
for (const { desc, ua, expect: { name, version } } of specs) {
9696
await t.step({

0 commit comments

Comments
 (0)