diff --git a/bun.lockb b/bun.lockb index 69740c6..5a81a26 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.ts b/index.ts index 64d889b..55fd87a 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,12 @@ +import structuredClone from '@ungap/structured-clone' + import methodConvert from '@/methods/convert' +if (!('structuredClone' in globalThis)) { + // @ts-ignore + globalThis.structuredClone = structuredClone +} + const numberToWordsRu = { convert: methodConvert, } diff --git a/package.json b/package.json index 596eb96..e7b5994 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "number-to-words-ru", - "version": "2.4.0", + "version": "2.4.1", "description": "Convert a number to words on russian language.", "author": "Anton Moskovskii (https://github.com/Ant1mas)", "homepage": "https://number-to-words-ru.ant1mas.dev/", @@ -22,6 +22,7 @@ }, "devDependencies": { "@types/jest": "^29.5.6", + "@types/ungap__structured-clone": "^1.2.0", "jest": "^29.7.0", "rollup-plugin-visualizer": "^5.9.2", "ts-jest": "^29.1.1", @@ -42,5 +43,8 @@ "files": [ "index.d.ts", "dist/**" - ] + ], + "dependencies": { + "@ungap/structured-clone": "^1.2.0" + } }