...
 
Commits (3)
<h1 align="center">Welcome to utfu 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.2.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-0.2.2-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
......
{
"name": "utfu",
"version": "0.2.1",
"version": "0.2.2",
"@pika/pack": {
"pipeline": [
[
......
<h1 align="center">Welcome to utfu 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.2.1-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-0.2.2-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
......
......@@ -4,7 +4,7 @@ const he = require('he');
const win = require('windows-1252');
const mappings = require('./mappings');
const mappings = require('./mappings.js');
const hex = str => {
if (typeof str !== 'string') throw new Error('utfu requires a string to process');
......
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["const he = require('he');\n\nconst win = require('windows-1252');\n\nconst mappings = require('./mappings');\n\nconst hex = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.hex);\n });\n return str;\n};\n\nconst txt = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.chars);\n });\n return str;\n};\n\nconst htx = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, he.encode(mapping.utf8.chars));\n });\n return str;\n};\n\nmodule.exports = {\n hex,\n txt,\n htx\n};"],"names":["he","require","win","mappings","hex","str","Error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,CAAU,mCAAV,CAAN;AAC7BD,EAAAA,GAAG,GAAGH,GAAG,CAACK,MAAJ,CAAWL,GAAG,CAACM,MAAJ,CAAWH,GAAX,CAAX,CAAN;AACAF,EAAAA,QAAQ,CAACM,OAAT,CAAiBC,OAAO,IAAI;AAC1BL,IAAAA,GAAG,GAAGA,GAAG,CAACM,OAAJ,CAAYD,OAAO,CAACE,SAAR,CAAkBC,KAA9B,EAAqCb,EAAE,CAACQ,MAAH,CAAUE,OAAO,CAACI,IAAR,CAAaE,KAAvB,CAArC,CAAN;AACD,GAFD;AAGA,SAAOX,GAAP;AACD,CAPD;;AASAa,MAAM,CAACC,OAAP,GAAiB;AACff,EAAAA,GADe;AAEfW,EAAAA,GAFe;AAGfE,EAAAA;AAHe,CAAjB"}
\ No newline at end of file
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["const he = require('he');\n\nconst win = require('windows-1252');\n\nconst mappings = require('./mappings.js');\n\nconst hex = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.hex);\n });\n return str;\n};\n\nconst txt = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.chars);\n });\n return str;\n};\n\nconst htx = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, he.encode(mapping.utf8.chars));\n });\n return str;\n};\n\nmodule.exports = {\n hex,\n txt,\n htx\n};"],"names":["he","require","win","mappings","hex","str","Error","decode","encode","forEach","mapping","replace","misrender","regex","utf8","txt","chars","htx","module","exports"],"mappings":";;AAAA,MAAMA,EAAE,GAAGC,OAAO,CAAC,IAAD,CAAlB;;AAEA,MAAMC,GAAG,GAAGD,OAAO,CAAC,cAAD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BC,OAAO,IAAI;AAC1BL,IAAAA,GAAG,GAAGA,GAAG,CAACM,OAAJ,CAAYD,OAAO,CAACE,SAAR,CAAkBC,KAA9B,EAAqCb,EAAE,CAACQ,MAAH,CAAUE,OAAO,CAACI,IAAR,CAAaE,KAAvB,CAArC,CAAN;AACD,GAFD;AAGA,SAAOX,GAAP;AACD,CAPD;;AASAa,MAAM,CAACC,OAAP,GAAiB;AACff,EAAAA,GADe;AAEfW,EAAAA,GAFe;AAGfE,EAAAA;AAHe,CAAjB"}
\ No newline at end of file
......@@ -2,7 +2,7 @@ const he = require('he');
const win = require('windows-1252');
const mappings = require('./mappings');
const mappings = require('./mappings.js');
const hex = str => {
if (typeof str !== 'string') throw new Error('utfu requires a string to process');
......
......@@ -2,7 +2,7 @@ const he = require('he');
const win = require('windows-1252');
const mappings = require('./mappings');
const mappings = require('./mappings.js');
const hex = str => {
if (typeof str !== 'string') throw new Error('utfu requires a string to process');
......
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["const he = require('he');\n\nconst win = require('windows-1252');\n\nconst mappings = require('./mappings');\n\nconst hex = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.hex);\n });\n return str;\n};\n\nconst txt = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.chars);\n });\n return str;\n};\n\nconst htx = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, he.encode(mapping.utf8.chars));\n });\n return str;\n};\n\nmodule.exports = {\n hex,\n txt,\n htx\n};"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB;AACA,MAAM,GAAG,GA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AG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI;AAC9B,IAAI,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,GAAG;AACjB,EAAE,GAAG;AACL,EAAE,GAAG;AACL,EAAE,GAAG;AACL,CAAC"}
\ No newline at end of file
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["const he = require('he');\n\nconst win = require('windows-1252');\n\nconst mappings = require('./mappings.js');\n\nconst hex = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.hex);\n });\n return str;\n};\n\nconst txt = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, mapping.utf8.chars);\n });\n return str;\n};\n\nconst htx = str => {\n if (typeof str !== 'string') throw new Error('utfu requires a string to process');\n str = win.decode(win.encode(str));\n mappings.forEach(mapping => {\n str = str.replace(mapping.misrender.regex, he.encode(mapping.utf8.chars));\n });\n return str;\n};\n\nmodule.exports = {\n hex,\n txt,\n htx\n};"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB;AACA,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACpC;AACA,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1C;AACA,MAAM,GAAG,GAAG,GAAG,IAAI;AACnB,EAAE,IA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,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,GAAG;AACjB,EAAE,GAAG;AACL,EAAE,GAAG;AACL,EAAE,GAAG;AACL,CAAC"}
\ No newline at end of file
{
"name": "utfu",
"description": "Replaces busted characters carried over from legacy text encodings with the proper UTF-8 character.",
"version": "0.2.1",
"version": "0.2.2",
"license": "MIT",
"files": [
"dist-*/",
......
const he = require('he')
const win = require('windows-1252')
const mappings = require('./mappings')
const mappings = require('./mappings.js')
const hex = str => {
if (typeof str !== 'string') throw new Error('utfu requires a string to process')
......
import { hex } from '../src/index.js'
import mappings from '../src/mappings'
import mappings from '../src/mappings.js'
mappings.forEach(mapping => {
const str = mapping.misrender.chars
......
import he from 'he'
import { htx } from '../src/index.js'
import mappings from '../src/mappings'
import mappings from '../src/mappings.js'
mappings.forEach(mapping => {
const str = mapping.misrender.chars
......
import { txt } from '../src/index.js'
import mappings from '../src/mappings'
import mappings from '../src/mappings.js'
mappings.forEach(mapping => {
const str = mapping.misrender.chars
......