Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use with keyword for import attributes #4141

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/unicode_width.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// Ported from unicode_width rust crate, Copyright (c) 2015 The Rust Project Developers. MIT license.

import data from "./_data.json" assert { type: "json" };
import data from "./_data.json" with { type: "json" };
import { runLengthDecode } from "./_rle.ts";

let tables: Uint8Array[] | null = null;
Expand Down
2 changes: 1 addition & 1 deletion html/_tools/generate_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion html/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const entityListRegexCache = new WeakMap<EntityList, RegExp>();
* unescape("&thorn;&eth;"); // "&thorn;&eth;"
*
* // Using the full named entity list from the HTML spec (~47K un-minified)
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" assert { type: "json" };
* import entityList from "https://deno.land/std@$STD_VERSION/html/named_entity_list.json" with { type: "json" };
*
* unescape("&thorn;&eth;", { entityList }); // "þð"
* ```
Expand Down
2 changes: 1 addition & 1 deletion html/entities_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { escape, unescape } from "./entities.ts";
import { assertEquals } from "../assert/mod.ts";
import entityList from "./named_entity_list.json" assert { type: "json" };
import entityList from "./named_entity_list.json" with { type: "json" };

Deno.test("escape()", async (t) => {
await t.step('escapes &<>"', () => {
Expand Down
10 changes: 5 additions & 5 deletions http/user_agent_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deno.test({
name: "UserAgent.prototype.browser",
async fn(t) {
const specs = (await import("./testdata/user_agent/browser-all.json", {
assert: { type: "json" },
with: { type: "json" },
})).default;
for (const { desc, ua, expect: { major, name, version } } of specs) {
await t.step({
Expand All @@ -29,7 +29,7 @@ Deno.test({
name: "UserAgent.prototype.cpu",
async fn(t) {
const specs = (await import("./testdata/user_agent/cpu-all.json", {
assert: { type: "json" },
with: { type: "json" },
})).default;
for (const { desc: name, ua, expect } of specs) {
await t.step({
Expand All @@ -47,7 +47,7 @@ Deno.test({
name: "UserAgent.prototype.device",
async fn(t) {
const specs = (await import("./testdata/user_agent/device-all.json", {
assert: { type: "json" },
with: { type: "json" },
})).default;
for (const { desc: name, ua, expect: { vendor, model, type } } of specs) {
await t.step({
Expand All @@ -69,7 +69,7 @@ Deno.test({
name: "UserAgent.prototype.engine",
async fn(t) {
const specs = (await import("./testdata/user_agent/engine-all.json", {
assert: { type: "json" },
with: { type: "json" },
})).default;
for (const { desc, ua, expect: { name, version } } of specs) {
await t.step({
Expand All @@ -90,7 +90,7 @@ Deno.test({
name: "UserAgent.prototype.os",
async fn(t) {
const specs = (await import("./testdata/user_agent/os-all.json", {
assert: { type: "json" },
with: { type: "json" },
})).default;
for (const { desc, ua, expect: { name, version } } of specs) {
await t.step({
Expand Down