Skip to content

dualcyclone/js-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-utils

Just a stuff to store all my JavaScript utilities

Namespace

A class to create namespaces for classes without needing to hard-code namespaces, eg:

jsutils.Namespace('path.to.name.space', {anything : true});

...Will create the object 'path.to.name.space' with the object defined in the method signature.

The class will throw an error if you attempt to create an object with the same namespace as an existing object


	// Will create path.to.name successfully
	jsutils.Namespace('path.to.name', {stuff : true});
	
	// Will create path.to.name.space successfully
	jsutils.Namespace('path.to.name.space', {anything : true});
		
	// Will throw an error
	jsutils.Namespace('path.to.name.space', {anything : true});

About

Just a stuff to store all my JavaScript utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published