From d26097762b11bfb9be0d64fc8b9c47be6b3d9f39 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Tue, 28 Apr 2020 11:29:33 -0700 Subject: add >w< and stutter + typings, v1.0.4 --- README.md | 4 ++-- dist/app.d.ts | 2 ++ dist/app.js | 8 +++++++- package.json | 3 ++- src/app.ts | 6 ++++++ test/test.js | 2 +- tsconfig.json | 2 +- 7 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 dist/app.d.ts diff --git a/README.md b/README.md index b1a45fd..8a9ff4a 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ $ npm install uwufy ```js const uwufy = require('uwufy'); -console.log(uwufy('IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFULL')); +console.log(uwufy('IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFULL!!!')); ``` # Output ```sh -$ IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFUWW +$ I-IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFUWW >w< ``` ## Links diff --git a/dist/app.d.ts b/dist/app.d.ts new file mode 100644 index 0000000..48eb464 --- /dev/null +++ b/dist/app.d.ts @@ -0,0 +1,2 @@ +declare const uwufy: (input: string) => string; +export = uwufy; diff --git a/dist/app.js b/dist/app.js index 036b716..faedfda 100644 --- a/dist/app.js +++ b/dist/app.js @@ -2,7 +2,13 @@ const uwufy = (input) => { input = input.replace(/(?:l|r)/g, 'w'); input = input.replace(/(?:L|R)/g, 'W'); + input = input.replace(/!+/g, ` >w< `); + let f = Math.random() < 0.25; + if (f) { + let c = input.charAt(0); + input = c + '-' + input; + } return input; }; module.exports = uwufy; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2FwcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxLQU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FDRCxpQkFBUyxLQUFLLENBQUMifQ== \ No newline at end of file diff --git a/package.json b/package.json index 8797a0b..84b5b91 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "uwufy", - "version": "1.0.3", + "version": "1.0.4", "description": "An NPM package which allows you to uwufy a given string.", "main": "./dist/app.js", + "types": "./dist/app.d.js", "files": [ "dist/", "LICENSE" diff --git a/src/app.ts b/src/app.ts index 9919eb4..f28037f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,6 +1,12 @@ const uwufy = (input: string): string => { input = input.replace(/(?:l|r)/g, 'w'); input = input.replace(/(?:L|R)/g, 'W'); + input = input.replace(/!+/g, ` >w< `); + let f = Math.random() < 0.25 + if (f) { + let c = input.charAt(0) + input = c + '-' + input + } return input; } export = uwufy; \ No newline at end of file diff --git a/test/test.js b/test/test.js index 8270d62..fdc1a67 100644 --- a/test/test.js +++ b/test/test.js @@ -1,3 +1,3 @@ const uwufy = require('../dist/app.js'); -console.log(uwufy('IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFULL')); \ No newline at end of file +console.log(uwufy('IF YOU SEE THIS THEN THE UWUFICATION WAS SUCCESSFULL!')); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 3bcd644..1bf09fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "allowJs": true, /* Allow javascript files to be compiled. */ "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ -- cgit v1.2.3