string-unfancy 4.1.0 → 5.0.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": "string-unfancy",
3
- "version": "4.1.0",
3
+ "version": "5.0.3",
4
4
  "description": "Replace all n/m dashes, curly quotes with their simpler equivalents",
5
5
  "keywords": [
6
6
  "alt",
@@ -30,17 +30,21 @@
30
30
  "email": "roy@codsen.com",
31
31
  "url": "https://codsen.com"
32
32
  },
33
- "main": "dist/string-unfancy.cjs.js",
34
- "module": "dist/string-unfancy.esm.js",
35
- "browser": "dist/string-unfancy.umd.js",
33
+ "type": "module",
34
+ "exports": {
35
+ "script": "./dist/string-unfancy.umd.js",
36
+ "default": "./dist/string-unfancy.esm.js"
37
+ },
36
38
  "types": "types/index.d.ts",
37
39
  "scripts": {
38
40
  "build": "rollup -c",
39
- "esbuild": "node '../../scripts/esbuild.js'",
40
- "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
41
41
  "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
42
+ "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
43
+ "clean_types": "../../scripts/cleanTypes.js",
42
44
  "dev": "rollup -c --dev",
43
45
  "devunittest": "npm run dev && tap --only -R 'base'",
46
+ "esbuild": "node '../../scripts/esbuild.js'",
47
+ "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
44
48
  "format": "npm run lect && npm run prettier && npm run lint",
45
49
  "lect": "lect",
46
50
  "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
@@ -48,22 +52,22 @@
48
52
  "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
49
53
  "republish": "npm publish || :",
50
54
  "tap": "tap",
51
- "tsc": "tsc",
52
55
  "pretest": "npm run build",
53
56
  "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
54
57
  "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
55
- "unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf",
56
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
57
- "clean_types": "../../scripts/cleanTypes.js"
58
+ "tsc": "tsc",
59
+ "unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
58
60
  },
59
61
  "tap": {
62
+ "check-coverage": false,
60
63
  "coverage-report": [
61
64
  "json-summary",
62
65
  "text"
63
66
  ],
64
- "nyc-arg": [
65
- "--exclude=**/*.cjs.js",
66
- "--exclude=**/*.umd.js"
67
+ "node-arg": [
68
+ "--no-warnings",
69
+ "--experimental-loader",
70
+ "@istanbuljs/esm-loader-hook"
67
71
  ],
68
72
  "timeout": 0
69
73
  },
@@ -81,45 +85,49 @@
81
85
  }
82
86
  },
83
87
  "dependencies": {
84
- "@babel/runtime": "^7.14.0",
88
+ "@babel/runtime": "^7.16.0",
85
89
  "he": "^1.2.0"
86
90
  },
87
91
  "devDependencies": {
88
- "@babel/cli": "^7.14.3",
89
- "@babel/core": "^7.14.3",
90
- "@babel/node": "^7.14.2",
91
- "@babel/plugin-external-helpers": "^7.12.13",
92
- "@babel/plugin-proposal-class-properties": "^7.13.0",
93
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
94
- "@babel/plugin-proposal-object-rest-spread": "^7.14.2",
95
- "@babel/plugin-proposal-optional-chaining": "^7.14.2",
96
- "@babel/plugin-transform-runtime": "^7.14.3",
97
- "@babel/preset-env": "^7.14.2",
98
- "@babel/preset-typescript": "^7.13.0",
99
- "@babel/register": "^7.13.16",
92
+ "@babel/cli": "^7.16.0",
93
+ "@babel/core": "^7.16.0",
94
+ "@babel/node": "^7.16.0",
95
+ "@babel/plugin-external-helpers": "^7.16.0",
96
+ "@babel/plugin-proposal-class-properties": "^7.16.0",
97
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
98
+ "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
99
+ "@babel/plugin-proposal-optional-chaining": "^7.16.0",
100
+ "@babel/plugin-transform-runtime": "^7.16.0",
101
+ "@babel/preset-env": "^7.16.0",
102
+ "@babel/preset-typescript": "^7.16.0",
103
+ "@babel/register": "^7.16.0",
104
+ "@istanbuljs/esm-loader-hook": "^0.1.2",
100
105
  "@rollup/plugin-babel": "^5.3.0",
101
- "@rollup/plugin-commonjs": "^19.0.0",
106
+ "@rollup/plugin-commonjs": "^21.0.1",
102
107
  "@rollup/plugin-json": "^4.1.0",
103
- "@rollup/plugin-node-resolve": "^13.0.0",
104
- "@rollup/plugin-strip": "^2.0.1",
105
- "@rollup/plugin-typescript": "^8.2.1",
106
- "@types/he": "^1.1.1",
107
- "@types/node": "^15.6.0",
108
- "@types/tap": "^15.0.1",
109
- "@typescript-eslint/eslint-plugin": "^4.24.0",
110
- "@typescript-eslint/parser": "^4.24.0",
111
- "core-js": "^3.12.1",
108
+ "@rollup/plugin-node-resolve": "^13.0.6",
109
+ "@rollup/plugin-strip": "^2.1.0",
110
+ "@rollup/plugin-typescript": "^8.3.0",
111
+ "@types/he": "^1.1.2",
112
+ "@types/node": "^16.11.6",
113
+ "@types/tap": "^15.0.5",
114
+ "@typescript-eslint/eslint-plugin": "^5.2.0",
115
+ "@typescript-eslint/parser": "^5.2.0",
116
+ "core-js": "^3.19.0",
112
117
  "cross-env": "^7.0.3",
113
- "eslint": "^7.27.0",
114
- "lect": "^0.17.0",
115
- "rollup": "^2.49.0",
118
+ "eslint": "^8.1.0",
119
+ "lect": "^0.18.3",
120
+ "rollup": "^2.59.0",
116
121
  "rollup-plugin-ascii": "^0.0.3",
117
122
  "rollup-plugin-banner": "^0.2.1",
118
123
  "rollup-plugin-cleanup": "^3.2.1",
119
- "rollup-plugin-dts": "^3.0.1",
124
+ "rollup-plugin-dts": "^4.0.0",
120
125
  "rollup-plugin-terser": "^7.0.2",
121
- "tap": "^14.11.0",
122
- "tslib": "^2.2.0",
123
- "typescript": "^4.2.4"
126
+ "tap": "^15.0.10",
127
+ "tslib": "^2.3.1",
128
+ "typescript": "^4.4.4"
129
+ },
130
+ "engines": {
131
+ "node": ">=12"
124
132
  }
125
133
  }
@@ -1,72 +0,0 @@
1
- /**
2
- * @name string-unfancy
3
- * @fileoverview Replace all n/m dashes, curly quotes with their simpler equivalents
4
- * @version 4.1.0
5
- * @author Roy Revelt, Codsen Ltd
6
- * @license MIT
7
- * {@link https://codsen.com/os/string-unfancy/}
8
- */
9
-
10
- 'use strict';
11
-
12
- Object.defineProperty(exports, '__esModule', { value: true });
13
-
14
- var _typeof = require('@babel/runtime/helpers/typeof');
15
- var he = require('he');
16
-
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
20
- var he__default = /*#__PURE__*/_interopDefaultLegacy(he);
21
-
22
- var version$1 = "4.1.0";
23
-
24
- var version = version$1;
25
- function existy(x) {
26
- return x != null;
27
- }
28
- function unfancy(str) {
29
- var CHARS = {
30
- "\xB4": "'",
31
- ʻ: "'",
32
- ʼ: "'",
33
- ʽ: "'",
34
- ˈ: "'",
35
- ʹ: "'",
36
- "\u0312": "'",
37
- "\u0313": "'",
38
- "\u0314": "'",
39
- "\u0315": "'",
40
- ʺ: '"',
41
- "\u201C": '"',
42
- "\u201D": '"',
43
- "\u2012": "-",
44
- "\u2013": "-",
45
- "\u2014": "-",
46
- "\u2018": "'",
47
- "\u2019": "'",
48
- "\u2026": "...",
49
- "\u2212": "-",
50
- "\uFE49": "-",
51
- "\xA0": " "
52
- };
53
- if (!existy(str)) {
54
- throw new Error("string-unfancy/unfancy(): [THROW_ID_01] The input is missing!");
55
- }
56
- if (typeof str !== "string") {
57
- throw new Error("string-unfancy/unfancy(): [THROW_ID_02] The input is not a string! It's: ".concat(_typeof__default['default'](str)));
58
- }
59
- var res = str;
60
- while (he__default['default'].decode(res) !== res) {
61
- res = he__default['default'].decode(res);
62
- }
63
- for (var i = 0, len = res.length; i < len; i++) {
64
- if (Object.prototype.hasOwnProperty.call(CHARS, res[i])) {
65
- res = res.slice(0, i) + CHARS[res[i]] + res.slice(i + 1);
66
- }
67
- }
68
- return res;
69
- }
70
-
71
- exports.unfancy = unfancy;
72
- exports.version = version;