@shgysk8zer0/polyfills 0.4.2 → 0.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgysk8zer0/polyfills",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A collection of JavaScript polyfills",
@@ -11,6 +11,18 @@
11
11
  ".": {
12
12
  "import": "./node.min.js",
13
13
  "require": "./node.min.js"
14
+ },
15
+ "./*.js": {
16
+ "import": "./*.js"
17
+ },
18
+ "./*.cjs": {
19
+ "import": "./*.js"
20
+ },
21
+ "./*.mjs": {
22
+ "import": "./*.js"
23
+ },
24
+ "./*": {
25
+ "import": "./*.js"
14
26
  }
15
27
  },
16
28
  "config": {
@@ -27,7 +39,7 @@
27
39
  }
28
40
  },
29
41
  "scripts": {
30
- "test": "npm run lint:js && npm run test:node && npm run lint:html",
42
+ "test": "npm run lint:js && npm run lint:html && npm run run:tests",
31
43
  "postinstall": "if [ -f './assets/dedent.cjs' ]; then npm run build; fi",
32
44
  "preversion": "npm test && npm run build",
33
45
  "prepare": "npm test && npm run build",
@@ -38,7 +50,7 @@
38
50
  "lint:html": "htmlhint \"**/*.html\"",
39
51
  "build": "npm run build:js",
40
52
  "build:js": "rollup -c rollup.config.js",
41
- "test:node": "node test/node.js",
53
+ "run:tests": "node --test *.test.js",
42
54
  "create:lock": "npm i --package-lock-only --ignore-scripts --no-audit --no-fund",
43
55
  "version:bump": "npm run version:bump:patch",
44
56
  "version:bump:patch": "npm version --no-git-tag-version patch && npm run create:lock",
@@ -72,6 +84,7 @@
72
84
  "devDependencies": {
73
85
  "@rollup/plugin-commonjs": "^26.0.1",
74
86
  "@rollup/plugin-node-resolve": "^15.2.3",
87
+ "@shgysk8zer0/eslint-config": "^1.0.1",
75
88
  "@shgysk8zer0/js-utils": "^1.0.1",
76
89
  "htmlhint": "^1.1.4",
77
90
  "http-server": "^14.1.1",
package/regexp.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ if (! (RegExp.escape instanceof Function)) {
3
+ const pattern = /[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;
4
+
5
+ RegExp.escape = function(input) {
6
+ return input.toString().replace(pattern, '\\$&');
7
+ };
8
+ }
File without changes
package/rollup.config.js DELETED
@@ -1,39 +0,0 @@
1
- import nodeResolve from '@rollup/plugin-node-resolve';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import terser from '@rollup/plugin-terser';
4
-
5
- export default [{
6
- input: 'assets/dedent.cjs',
7
- plugins: [nodeResolve(), commonjs()],
8
- output: [{
9
- file: 'assets/dedent.js',
10
- format: 'esm',
11
- }]
12
- }, {
13
- input: 'assets/url-pattern.cjs',
14
- plugins: [nodeResolve(), commonjs()],
15
- output: [{
16
- file: 'assets/url-pattern.js',
17
- format: 'esm',
18
- }]
19
- }, {
20
- // Browser bundle
21
- input: 'all.js',
22
- plugins: [nodeResolve()],
23
- output: [{
24
- file: 'all.min.js',
25
- format: 'iife',
26
- plugins: [terser()],
27
- sourcemap: true,
28
- }],
29
- }, {
30
- // Node.js bundles
31
- input: 'node.js',
32
- plugins: [nodeResolve()],
33
- output: [{
34
- file: 'node.min.js',
35
- format: 'iife',
36
- plugins: [terser()],
37
- sourcemap: true,
38
- }],
39
- }];