Skip to content

Commit

Permalink
always import to satisfy vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Aug 3, 2023
1 parent 1405ee6 commit 709d49f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/toUSVString-default.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import StringPrototypeToWellFormed from "./lib/StringPrototypeToWellFormed.js";

let toUSVString: (s: string) => string;
// @ts-ignore
if (String.prototype.toWellFormed) {
// @ts-ignore
toUSVString = Object.call.bind(String.prototype.toWellFormed);
} else {
toUSVString =
require("./lib/StringPrototypeToWellFormed.js") as typeof import("./lib/StringPrototypeToWellFormed.js");
toUSVString = StringPrototypeToWellFormed;
}

export = toUSVString;

0 comments on commit 709d49f

Please sign in to comment.