Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
selfagency committed Apr 28, 2020
1 parent 2e38068 commit d1e5458
Show file tree
Hide file tree
Showing 24 changed files with 9,329 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
57 changes: 57 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"parserOptions": {
"sourceType": "module",
"parser": "babel-eslint",
"allowImportExportEverywhere": true,
"ecmaVersion": 2017,
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"commonjs": true,
"es6": true
},
"extends": ["plugin:security/recommended"],
"plugins": ["import", "node", "prettier", "promise", "security", "standard"],
"rules": {
"indent": ["off"],
"no-eval": ["error"],
"no-script-url": ["error"],
"linebreak-style": ["warn", "unix"],
"quotes": ["warn", "single"],
"semi": ["warn", "never"],
"no-undef": ["off"],
"require-jsdoc": [
"off",
{
"require": null,
"FunctionDeclaration": [true],
"MethodDefinition": [true],
"ClassDeclaration": [true],
"ArrowFunctionExpression": [true],
"FunctionExpression": [true]
}
],
"valid-jsdoc": ["warn"],
"no-useless-escape": ["off"],
"key-spacing": ["off"],
"wrap-iife": ["error", "inside"],
"handle-callback-err": ["error"],
"callback-return": ["error"],
"no-mixed-requires": ["error"],
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "i|res|next|^err"
}
],
"security/detect-non-literal-fs-filename": ["off"],
"security/detect-non-literal-regexp": ["off"],
"security/detect-non-literal-require": ["off"],
"security/detect-object-injection": ["off"],
"vue/html-self-closing": ["off"],
"vue/no-v-html": ["off"],
"vue/max-attributes-per-line": ["off"]
}
}
156 changes: 156 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
Fetch template
//www.gitignore.io/api/linux,macos,dotenv,node
# Edit at https://www.gitignore.io/?templates=linux,macos,dotenv,node

### dotenv ###
.env

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# rollup.js default build output
dist/

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Temporary folders
tmp/
temp/

# End of https://www.gitignore.io/api/linux,macos,dotenv,node
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"printWidth": 120,
"proseWrap": "preserve",
"semi": false,
"singleQuote": true,
"tabWidth": 2
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deepscan.enable": true
}
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2020, Daniel Sieradski

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<h1 align="center">Welcome to utfu 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.1.0-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
<a href="https://twitter.com/selfagency_llc" target="_blank">
<img alt="Twitter: selfagency\_llc" src="https://img.shields.io/twitter/follow/selfagency_llc.svg?style=social" />
</a>
</p>

> Attempts to fix busted character encodings carried over from legacy text formats. This is a work-in-progress and not yet ready for production use.
## Install

```sh
yarn add utfu | npm install utfu
```

## Usage

Instantiate, then pass a string to either method, `hex` or `txt`. The former tries to do a regex search and replace for unicode chars. The latter tries to do a search and replace for characters in their typical misrendering (see chart [here](https://www.i18nqa.com/debug/utf8-debug.html)).

```javascript
import Utfu from 'utfu'

const dirtyText = 'On a certain level, it�s like shouting �fire� in a crowded theater.'

const utfu = new Utfu()

const cleanText = utfu.hex(dirtyText) || utfu.txt(dirtyText)
```

## Run tests

```sh
yarn run test
```

## Author

👤 **Daniel Sieradski <[email protected]>**

- Website: [self.agency](https://self.agency)
- Twitter: [@selfagency_llc](https://twitter.com/selfagency_llc)
- GitLab: [@selfagency](https://gitlab.com/selfagency)
- LinkedIn: [@selfagency](https://linkedin.com/in/selfagency)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://gitlab.com/selfagency/utfu/issues).

## Show your support

Give a ⭐️ if this project helped you!

---

_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// babel.config.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
Loading

0 comments on commit d1e5458

Please sign in to comment.