@shgysk8zer0/polyfills 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/element.js CHANGED
@@ -1,4 +1,3 @@
1
- import './dialog.js';
2
1
  import { aria } from './aom.js';
3
2
 
4
3
  if (! (HTMLScriptElement.supports instanceof Function)) {
@@ -127,7 +126,7 @@ if (! (HTMLImageElement.prototype.decode instanceof Function)) {
127
126
  if (
128
127
  ! (Element.prototype.setHTML instanceof Function)
129
128
  && 'Sanitizer' in globalThis
130
- && globalThis.Sanitizer.sanitizeFor instanceof Function
129
+ && globalThis.Sanitizer.prototype.sanitizeFor instanceof Function
131
130
  ) {
132
131
  Element.prototype.setHTML = function setHTML(input, { sanitizer = new globalThis.Sanitizer() } = {}) {
133
132
  if (
package/globalThis.js CHANGED
@@ -3,14 +3,7 @@
3
3
 
4
4
  if (typeof globalThis === 'undefined') {
5
5
  /* global global: true */
6
- if (typeof self !== 'undefined') {
7
- Object.defineProperty(self, 'globalThis', {
8
- enumerable: false,
9
- writable: true,
10
- configurable: true,
11
- value: self,
12
- });
13
- } else if (typeof window !== 'undefined') {
6
+ if (typeof window !== 'undefined') {
14
7
  Object.defineProperty(Window.prototype, 'globalThis', {
15
8
  enumerable: false,
16
9
  writable: true,
@@ -24,6 +17,13 @@
24
17
  configurable: true,
25
18
  value: global,
26
19
  });
20
+ } else if (typeof self !== 'undefined') {
21
+ Object.defineProperty(self, 'globalThis', {
22
+ enumerable: false,
23
+ writable: true,
24
+ configurable: true,
25
+ value: self,
26
+ });
27
27
  } else {
28
28
  Object.defineProperty(this, 'globalThis', {
29
29
  enumerable: false,
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@shgysk8zer0/polyfills",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "private": false,
5
5
  "description": "A collection of JavaScript polyfills",
6
+ "main": "all.min.js",
7
+ "module": "all.js",
6
8
  "config": {
7
9
  "serve": {
8
10
  "domain": "localhost",
@@ -47,10 +49,10 @@
47
49
  },
48
50
  "homepage": "https://github.com/shgysk8zer0/polyfills#readme",
49
51
  "devDependencies": {
52
+ "@rollup/plugin-terser": "^0.4.1",
50
53
  "eslint": "^8.40.0",
51
54
  "htmlhint": "^1.1.4",
52
55
  "http-server": "^14.1.1",
53
- "rollup": "^2.79.1",
54
- "rollup-plugin-terser": "^7.0.2"
56
+ "rollup": "^2.79.1"
55
57
  }
56
58
  }
package/rollup.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-env node */
2
- import { terser } from 'rollup-plugin-terser';
2
+ import terser from '@rollup/plugin-terser';
3
3
 
4
4
  export default {
5
5
  input: 'all.js',
@@ -8,7 +8,5 @@ export default {
8
8
  format: 'iife',
9
9
  sourcemap: true,
10
10
  },
11
- plugins: [
12
- terser(),
13
- ],
11
+ plugins: [terser()],
14
12
  };
File without changes