Skip to content

Commit

Permalink
fix old Node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Feb 17, 2021
1 parent 9f02dc5 commit 9d9fd39
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable */
import { TextDecoder } from '../text-decoder'

var Module = (function () {
// var _scriptDir = import.meta.url

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable */
import { TextDecoder } from '../text-decoder'

var Module = (function () {
// var _scriptDir = import.meta.url

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TextDecoder } from '../text-decoder'

let wasm

let cachedTextDecoder = new TextDecoder('utf-8', {
Expand Down
4 changes: 4 additions & 0 deletions packages/next/next-server/server/lib/squoosh/text-decoder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const textDecoder =
typeof TextDecoder !== 'undefined' ? TextDecoder : require('util').TextDecoder

export { textDecoder as TextDecoder }
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable */
import { TextDecoder } from '../text-decoder'

var Module = (function () {
// var _scriptDir = import.meta.url

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable */
import { TextDecoder } from '../text-decoder'

var Module = (function () {
// var _scriptDir = import.meta.url

Expand Down

0 comments on commit 9d9fd39

Please sign in to comment.