mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-07-11 07:03:45 +02:00
dc10a90851
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
23 lines
707 B
JavaScript
23 lines
707 B
JavaScript
// reverse-words transform
|
|
import BaseTransformer from '../BaseTransformer.js';
|
|
|
|
export default new BaseTransformer({
|
|
|
|
name: 'Reverse Words',
|
|
priority: 40,
|
|
func: function(text) {
|
|
return text.split(/(\s+)/).reverse().join('');
|
|
},
|
|
preview: function(text) {
|
|
if (!text) return '[rev words]';
|
|
// Take last 2-3 words and reverse them to show the effect
|
|
const words = text.split(/\s+/);
|
|
const lastWords = words.slice(-3).join(' ');
|
|
return this.func(lastWords) + '...';
|
|
},
|
|
reverse: function(text) {
|
|
// Reversing words twice restores
|
|
return this.func(text);
|
|
}
|
|
|
|
}); |