Returns True if a string contains a variation of 'OwO'
Project description
is-furry
Checks if a string has "owo" or "uwu" in it (or replaces the matches). Various options and multiple strictness settings from "owo" to "0,w u"
Setup
- Install the module
npm install is-furry or using
yarn
yarn add is-furry - Use it in your code
import isFurry from 'is-furry'
// Or using CommonJS
const { default: isFurry } = require('is-furry')
Options
The values shown in this example are the defaults. Custom options will overwrite the defaults.
isFurry('Is this message furry owo', {
fold: false,
// Whether to use `fold-to-ascii` to detect more characters,
foldMode: 'keep',
/* If set to 'replace', non-ascii characters that could not be turned into ascii will
be replaced with the string specified in 'foldReplacement' */
foldReplacement: '',
// String to replace unknown characters with (if using 'replace' in 'foldMode')
outputMode: 'boolean',
/* Which output mode to use:
'boolean' - returns either true or false
'number' - returns the amount of detected words (no overlap)
'string' - replaces owo or uwu with value specified in 'outputReplacement'.
'array' - returns an array of detected words. Empty array if no words are found */
outputReplacement: '',
/* String to replace detected words with (if using 'string' in 'outputMode').
Use '$&' for the matched word (for example, if you want to replace 'owo'
with '~~owo~~' you should use '~~$&~~') */
strictness: 1,
/* Strictness ranging from 0 to 2 (more may be coming in the future):
0 - basic. Detects exactly 'owo' or 'uwu'
1 - regular. Detects 'owu', 'uwo', '0w0' and such
2 - strict. Ignores some characters between letters. Will detect '0,,**w**uuuu'
*/
checkWordBoundaries: true,
/* Whether to ignore matches that aren't their own word:
false - would detect 'owo' in 'coworker'
true - would not detect 'owo' in 'coworker' */
})
Keeping options
If you need to do this a lot, having to include out the options every time is not ideal. It's a better idea to create an object to store your options.
const isFurryOptions = {
fold: true,
outputMode: 'replace',
outputReplacement: '**$&**',
strictness: 1,
checkWordBoundaries: true
}
isFurry('message owo', isFurryOptions) // => 'message **owo**'
License
The project is licensed under MIT
Contributing
If you would like to contribute to this package, please read the contributing guide.
Thanks to jakobkg for improving the typings!
Support
Add me on Discord Wait What#497(five)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for is_furry_py-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5d23e414690c4a579a05df72faf8a1ce12223220b97748fce94f1ce60148294 |
|
MD5 | 1f6b434d506003b4e5188355f513e371 |
|
BLAKE2b-256 | d75b6b5558e4fc7954b5436e8b4976b28bf99fd63ca0966aa4ee0fc6346d144b |