Verified Commit 67f1b10a authored by Daniel Sieradski's avatar Daniel Sieradski 💬

bundled build

parent c59f7de9
......@@ -14,9 +14,15 @@
[
"@pika/plugin-build-node"
],
[
"@pika/plugin-bundle-node"
],
[
"@pika/plugin-build-web"
],
[
"@pika/plugin-bundle-web"
],
[
"@pika/plugin-build-types"
]
......@@ -39,14 +45,17 @@
"private": false,
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-env": "^7.9.6",
"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.9.2",
"@pika/plugin-build-types": "^0.9.2",
"@pika/plugin-build-web": "^0.9.2",
"@pika/plugin-bundle-node": "^0.9.2",
"@pika/plugin-bundle-web": "^0.9.2",
"@pika/plugin-standard-pkg": "^0.9.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.4.0",
"babel-loader": "^8.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
......@@ -56,6 +65,7 @@
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-standard": "^4.0.1",
"jest": "^25.4.0",
"pika-plugin-minify": "^0.1.0",
"prettier": "^2.0.5",
"typescript": "^3.8.3"
},
......
......@@ -9,7 +9,7 @@
</a>
</p>
> Replaces busted characters carried over from legacy text encodings with the proper UTF-8 character.
> Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.
## Install
......@@ -21,11 +21,11 @@ yarn add utfu || npm install utfu
Say you've got a string that looks like this:
`There's no way I'm paying €30 for that!`
`There’s no way I’m paying €30 for that!`
Pass it to either method, `hex`, `txt`, or `htx` and you'll hopefully get back:
`There's no way I'm paying €30 for that!`
`There’s no way I’m paying €30 for that!`
`hex` substitutes unicode hex values (ie., `\u20ac`), which is useful in some contexts. `txt` substitutes the actual character (ie., `€`). And `htx` substitutes the HTML escape sequence (ie., `&#x20AC;`). See chart [here](https://www.i18nqa.com/debug/utf8-debug.html) for mappings.
......@@ -39,7 +39,7 @@ const cleanText = hex(dirtyText) || txt(dirtyText)
// --> 'On a certain level, it’s like shouting “fire” in a crowded theater.'
const cleanHTML = htx(dirtyText)
// --> 'On a certain level, it&#x2019;s like shouting &#x201C;fire&#x201D; in a crowded theater.'
// --> 'On a certain level, it&#x2019;s like shouting &#x201C;fire&#x201D; in a crowded theater.'
```
## Run tests
......@@ -57,6 +57,10 @@ yarn run test
- GitLab: [@selfagency](https://gitlab.com/selfagency)
- LinkedIn: [@selfagency](https://linkedin.com/in/selfagency)
## Acknowledgements
Gracious thanks to [Mathias Bynens](https://mathiasbynens.be/), upon whose [he](https://github.com/mathiasbynens/he) and [windows-1252](https://github.com/mathiasbynens/windows-1252) packages this project depends.
## 🤝 Contributing
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://gitlab.com/selfagency/utfu/issues).
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
'use strict';
const he = require('he');
Object.defineProperty(exports, '__esModule', { value: true });
const win = require('windows-1252');
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
const mappings = [{
var he = _interopDefault(require('he'));
var win = _interopDefault(require('windows-1252'));
var mappings = [{
misrender: {
chars: '€',
hex: '\u00e2\u201a\u00ac',
......@@ -2620,9 +2623,7 @@ const htx = str => {
return str;
};
module.exports = {
hex,
txt,
htx
};
exports.hex = hex;
exports.htx = htx;
exports.txt = txt;
//# sourceMappingURL=index.js.map
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
declare var _default: {
misrender: {
chars: string;
hex: string;
regex: RegExp;
};
utf8: {
chars: string;
hex: string;
regex: RegExp;
};
}[];
export default _default;
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
const he = require('he');
import he from 'he';
import win from 'windows-1252';
const win = require('windows-1252');
const mappings = [{
var mappings = [{
misrender: {
chars: '€',
hex: '\u00e2\u201a\u00ac',
......@@ -2618,9 +2617,5 @@ const htx = str => {
return str;
};
module.exports = {
hex,
txt,
htx
};
export { hex, htx, txt };
//# sourceMappingURL=index.js.map
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "utfu",
"description": "Replaces busted characters carried over from legacy text encodings with the proper UTF-8 character.",
"description": "Replaces busted characters carried over from legacy text encodings with the proper UTF-8 characters.",
"version": "0.2.3",
"license": "MIT",
"files": [
......@@ -21,20 +21,22 @@
],
"repository": "https://gitlab.com/selfagency/utfu.git",
"dependencies": {
"escape-unicode": "^0.2.0",
"he": "^1.2.0",
"windows-1252": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-env": "^7.9.6",
"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.9.2",
"@pika/plugin-build-types": "^0.9.2",
"@pika/plugin-build-web": "^0.9.2",
"@pika/plugin-bundle-node": "^0.9.2",
"@pika/plugin-bundle-web": "^0.9.2",
"@pika/plugin-standard-pkg": "^0.9.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.4.0",
"babel-loader": "^8.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
......@@ -44,6 +46,7 @@
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-standard": "^4.0.1",
"jest": "^25.4.0",
"pika-plugin-minify": "^0.1.0",
"prettier": "^2.0.5",
"typescript": "^3.8.3"
},
......@@ -51,5 +54,6 @@
"esnext": "dist-src/index.js",
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"browser": "dist-web/index.bundled.js",
"types": "dist-types/index.d.ts"
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment