Skip to content

Commit

Permalink
Revert "Fix #92"
Browse files Browse the repository at this point in the history
This reverts commit 38ae98a.
  • Loading branch information
samgozman committed Jun 22, 2021
1 parent a024a62 commit 3c87349
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 149 deletions.
4 changes: 2 additions & 2 deletions dist/yopta.js

Large diffs are not rendered by default.

215 changes: 72 additions & 143 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "yopta",
"version": "2.0.0",
"version": "2.0.1",
"description": "YoptaScript - язык программирования для гопников и реальных пацанов.",
"main": "dist/yopta.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -29,6 +29,7 @@
},
"homepage": "https://yopta.space/",
"devDependencies": {
"@types/globalthis": "^1.0.1",
"@types/jest": "^26.0.23",
"@types/node": "^15.12.1",
"@typescript-eslint/eslint-plugin": "^4.27.0",
Expand All @@ -44,5 +45,8 @@
},
"files": [
"dist/**/*"
]
],
"dependencies": {
"globalthis": "^1.0.2"
}
}
5 changes: 3 additions & 2 deletions src/core.ts
@@ -1,3 +1,4 @@
import polyfill from 'globalthis';
import dictionary from './dictionary/sortedYopta.json';

function escapeRegExp(str: string) {
Expand Down Expand Up @@ -70,5 +71,5 @@ export function compile(text: string, lang: 'js' | 'ys' = 'ys'): string {

// YoptaScript to globals
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const _global = (typeof window !== 'undefined' ? window : global) as any;
_global.yopta = compile;
const globalThis = polyfill() as any;
globalThis.yopta = compile;

0 comments on commit 3c87349

Please sign in to comment.