ƒ
ƒ is a library of daily-needed utils for javascript developers.
Used on our own libraries, and maybe on yours, no one wants to reinvent the wheel everytime they need it.
Why ƒ?
- Represent mathematical function!
- Was used on older Apple systems to represent a folder.
- ƒ is easier to write: (at least at Mac OS)
- Mac - Alt + Shift + f
- Windows - Alt + 159
- Linux - CHANGEME :D
If you don't want to use ƒ as variable name, we advise you to use Util
(capitalized, so you won't have problems in case you use nodejs's util
)
Instalation
npm install findhit-util --save
Usage
var ƒ = ;// OR// var Util = require( 'findhit-util' ); // Everyday use ƒ ƒ ƒ ƒ ƒ ƒ ƒ // Dynamic methods (that calls inner ones) ƒ <- ƒ * ƒArray <- ƒArray * ƒObject <- ƒObject ƒ * ƒArray * ƒObject // IsIsnt - Type validation // Is ƒis; // Default registered Constructors ƒis; ƒis; ƒis; ƒis; ƒis; ƒis; ƒis; ƒis; ƒis; ƒisundefined variable ; ƒis; // Isnt ƒisnt; // Default registered Constructors ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisnt; ƒisntundefined variable ; ƒisnt; // Custom constructor register // This is great, not just to use on your app, but to be used also by who uses your app // You could easily register your plugin's constructor on ƒ // We use this lib on `findhit-promise`, and we have registered it on IsIsnt like this: ƒisisnt; // Now, if someone uses `findhit-promise` and also `findhit-util` can check without // having to register it again!! :) ƒis // We have added also a custom register that accepts one or two functions for evaluation // ƒ.isisnt.registerCustom( keys, isFn, [ isntFn ] ); // You could bind it to one key ƒisisnt; // or bind it to multiple ƒisisnt; // This would make available: ƒis // true ƒisnt // false ƒis // false ƒisnt // true ƒis // false ƒisnt // true ƒis // true ƒisnt // false // if isnt evaluation is different than is, you could supply isnt function ƒisisnt; // By Type // Array utils // ƒ.array OR ƒ.Array // is / isnt binds ƒArray ƒArray ƒArray <- ƒArray ƒArray ƒArray // String utils // ƒ.string OR ƒ.String // is / isnt binds ƒString ƒString ƒString ƒString ƒString // Heyyo ƒString // heyyo // Case conversions // from CamelCase to ... ƒString // 'hey_yo' ƒString // 'hey-yo' ƒString // 'Hey Yo' // from underscore_case to ... ƒString // 'HeyYo' ƒString // 'hey-yo' ƒString // 'Hey Yo' // from dash-case to ... ƒString // 'HeyYo' ƒString // 'hey_yo' ƒString // 'Hey Yo' // Function utils // ƒ.function OR ƒ.Function // is / isnt binds ƒFunction ƒFunction // Analysis ƒFunction // logs all arguments into console.log; // Return returners ƒFunction // Returns a function that returns the value on each execution ƒFunction // false ƒFunction // true ƒFunction // null ƒFunction // undefined // get function parameter names ƒFunction // [ 'a', 'b', 'c' ] ƒFunction // [ 'a', 'b', 'c' ] ƒFunction // [ 'a', 'c' ] ƒFunction // [ 'a', 'c' ] // Object utils // ƒ.object OR ƒ.Object // is / isnt binds ƒObject ƒObject ƒObject <- ƒObject ƒObject // RegExp utils // ƒ.RegExp OR ƒ.regexp OR ƒ.Regexp ƒRegExp // Return a regex to match alphanumeric-spaced strings ƒRegExp // true ƒRegExp // false ƒRegExp // Array with matches ƒRegExp // false // Now, the most exciting thing arround RegExp, the querifier!! // Imagine that you need, on a clever way to filter strings // Here is the solution: ƒ.RegExp.querifier() var regexp = ƒRegExp; // magical regexp ƒRegExp; // [ 'John Something Doe' ]