Skip to content

centurianii/g3utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

g3utils

Basic javascript utilities that would be valuable in our projects consisting mainly by functions and sometimes small-sized objects.

This is an ongoing repository and things will be added or removed very often.

Testing is still ongoing not even from this container but also from all other js* projects.

See it at: http://jsfiddle.net/centurianii/3Jy4y/

Design

Internally, the whole design exploits a variation of the module pattern and builds on a bigger library as it would be revealed in the forthcoming projects.

A note on my library symbol:

It's the '$$' internally but if you edit it at the last line (window.$$ = window.$$ || {}) you can name it whatever you want and call it like so externally! Also, see Update.

Some calls:

//encode-decode a string
var str1 = 'fhj σρΘΥ \'%^"*&@';
var enc = $$.utils.htmlEntities( str );
//get the initial string back
var str2 = $$.utils.decodeHtmlEntities( enc );
alert(str1 === str2);

//find the type of an identifier
var x = 5;
alert($$.utils.typeOf(x) === 'number');
x = 'Hello!';
alert($$.utils.typeOf(x) === 'string');
x = [1, 2, 3];
alert($$.utils.typeOf(x) === 'array');
x = new Object();
alert($$.utils.typeOf(x) === 'object');
x = function(){}
alert($$.utils.typeOf(x) === 'function');

A note on jQuery:

My library is independent but can become a jQuery plugin with a simple assignment!

Update

My namespace moved from $$ to g3 and so all my projects moved from js<project-name> to g3<project-name> meaning: at global object g3 look for member <project-name>, ex.

  • g3debug object g3.debug
  • g3utils object g3.utils

Have fun!

About

Basic javascript utilities that would be valuable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published