Utils useful for Editor.js tools development
npm install @editorjs/helpers
- beautifyShortcut - Make shortcut command more human-readable
- cacheable - Decorator which provides ability to cache method or accessor result
- capitalize - Capitalizes first letter of the string
- copyTextToClipboard - Copies passed text to the clipboard
- debounce - Debouncing method
- deepMerge - Merge two objects recursively
- deprecationAssert - Common method for printing a warning about the usage of deprecated property or method.
- isEmpty - True if passed variable is null/undefined/''/{}
- notEmpty - True if passed variable is not null/undefined/''/{}
- equals - Compares two values with unknown type
- getValidUrl - Returns valid URL. If it is going outside and valid, it returns itself
- isPrintableKey - Returns true if passed key code is printable (a-Z, 0-9, etc) character.
- throttle - Returns a function, that, when invoked, will only be triggered at most once during a given window of time.
- isBoolean - Checks if passed argument is boolean
- isClass - Check if passed function is a class
- isFunction - Check if passed variable is a function
- isNumber - Checks if passed argument is number
- isObject - Checks if passed argument is an object
- isPromise - Check if passed object is a Promise
- isString - Checks if passed argument is a string
- isUndefined - Checks if passed argument is undefined
- typeOf - Return string representation of the object type
- getUserOS - Returns object with os name as key and boolean as value. Shows current user OS
CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are open for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.
🌐 | Join 👋 | ||
---|---|---|---|
codex.so | codex.so/join | @codex_team | @codex_team |