README
Build Status"> sjljs
Aside Note:
This library is no longer being supported.
Use the library's spiritual successor instead:
fjl (Functional javascript library).
Intro
A library for writing strongly typed javascript and solid classical oop. Also for making your applications, components, and libraries more concise.
Not meant to replace popular libraries like Backbone, Underscore, or Jquery etc.. Only meant as a supplement to them or as a supplement to applications requiring quick ramp up.
Note:
(This change only affects node users)
Reinstated all members of sjl.ns.stdlib
to also be available on sjl.stdlib...
and also to be accessible directly on sjl
.
Jsdocs
Api for current version:
- [7.0.x] (https://elycruz.github.io/sjljs/)
- [6.4.x] (http://sjljs.elycruz.com/6.4.x/jsdocs)
Docs for previous versions:
- [6.3.x] (http://sjljs.elycruz.com/6.3.x/jsdocs)
- [6.2.x] (http://sjljs.elycruz.com/6.2.x/jsdocs)
- [6.1.x] (http://sjljs.elycruz.com/6.1.x/jsdocs)
- [6.0.x (under construction)] (http://sjljs.elycruz.com/6.0.x/jsdocs)
- [5.6.34 (view readme in branch)] (https://github.com/elycruz/sjljs/tree/5.6.0-alpha)
- [5.0.x (view readme in branch)] (https://github.com/elycruz/sjljs/tree/5.0.XX)
- [0.5.x (view readme in branch)] (https://github.com/elycruz/sjljs/tree/0.5.x)
Sections in Readme:
Getting Started:
Include either the full library './sjl[.min].js' or the minimal version './sjl-minimal[.min].js' (the minimal version only includes the core and no classes or constructors from it's other packages).
Other Packages and members:
Legend
- (m) - Member prefix. Denotes item is a member; E.g., A constructor, method or a property.
- (p) - Package prefix. Denotes item is a package; E.g., an object with access to package members directly on it.
Other Packages and Members List:
Sjl direct Members and Methods:
Legend
- (m) - Member prefix. Denotes item is a member; E.g., A method or property.
Members/Methods:
- (m) sjl.argsToArray
- (m) sjl.arrayLikeToArray
- (m) sjl.notArrayLikeToArray
- (m) sjl.autoNamespace
- (m) sjl.camelCase
- (m) sjl.classOf
- (m) sjl.classOfIs
- (m) sjl.classOfIsMulti
- (m) sjl.classicalToStringMethod
- (m) sjl.clone
- (m) sjl.compose
- (m) sjl.concatArrayLikes
- (m) sjl.constrainPointer
- (m) sjl.curry
- (m) sjl.curryN
- (m) sjl.curry1
- (m) sjl.curry2
- (m) sjl.curry3
- (m) sjl.curry4
- (m) sjl.curry5
- (m) sjl.defineSubClass
- (m) sjl.defineSubClassPure
- (m) sjl.defineEnumProp
- (m) sjl.empty
- (m) sjl.emptyMulti
- (m) sjl.extend
- (m) sjl.extractBoolFromArrayEnd
- (m) sjl.extractBoolFromArrayStart
- (m) sjl.extractFromArrayAt
- (m) sjl.forEach
- (m) sjl.forEachInObj
- (m) sjl.getIterator
- (m) sjl.getArrayLikes
- (m) sjl.hasMethod
- (m) sjl.hasIterator
- (m) sjl.implode
- (m) sjl.isset
- (m) sjl.issetMulti
- (m) sjl.issetAndOfType
- (m) sjl.isEmpty
- (m) sjl.isEmptyObj
- (m) sjl.isEmptyOrNotOfType
- (m) sjl.isArray
- (m) sjl.isBoolean
- (m) sjl.isFunction
- (m) sjl.isNull
- (m) sjl.isNumber
- (m) sjl.isObject
- (m) sjl.isString
- (m) sjl.isSymbol
- (m) sjl.isUndefined
- (m) sjl.iteratorToArray
- (m) sjl.jsonClone
- (m) sjl.lcaseFirst
- (m) sjl.mapToArray
- (m) sjl.mergeOnProps
- (m) sjl.mergeOnPropsMulti
- (m) sjl.notEmptyAndOfType
- (m) sjl.objToArrayMap
- (m) sjl.objToArray
- (m) sjl.restArgs
- (m) sjl.searchObj
- (m) sjl.setToArray
- (m) sjl.throwTypeErrorIfNotOfType
- (m) sjl.throwTypeErrorIfEmptyOrNotOfType
- (m) sjl.throwTypeErrorIfEmpty
- (m) sjl.toArray
- (m) sjl.ucaseFirst
- (m) sjl.unConfigurableNamespace
- (m) sjl.unset
- (m) sjl.valueOrDefault
- (m) sjl.wrapPointer
- (m) sjl.Symbol
- (m) sjl._
- (m) sjl.isNodeEnv
- (m) sjl.ns
- (m) sjl.package
- (m) sjl.generated
- (m) sjl.nodejs
- (m) sjl.sjl
- (m) sjl.stdlib
(m) sjl.Either
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.Identity
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.Maybe
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.Monad
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.Symbol
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl._
This is a place holder member. It is an immutable value that can be used to represent a placeholder other than null;
E.g., used by sjl.curry
and sjl.curryN
to allow curry functions and using place holders for values
you're not ready to passed in; E.g.,
var slice = Array.prototype.slice,
add = function () {...}, // recursively adds
multiply = function () {...}; // recursively multiplies
sjl.curry(add, __, __, __)(1, 2, 3, 4, 5) === 15 // `true`
sjl.curry(multiply, __, 2, __)(2, 2) === Math.pow(2, 3) // `true`
sjl.curry(divide, __, 625, __)(3125, 5)
Back to sjl direct members and methods list.
(m) sjl.argsToArray
Same as Array.prototype.slice but neatly packaged for reuse; Also essentially used to convert an arguments
object
to an actual array.
E.g.,
function someFunction () {
// `arguments` gets returned as an actual array here.
return sjl.argsToArray(arguments).map( arg => someProcess(arg) );
}
Back to sjl direct members and methods list.
(m) sjl.arrayLikeToArray
Converts array likes (Set, Map, SjlSet, SjlMap, Array, Arguments) to arrays (returns passed in arrays untouched).
Back to sjl direct members and methods list.
(m) sjl.autoNamespace
Allows you to set or get a path on an object by namespace string.
Back to sjl direct members and methods list.
(m) sjl.camelCase
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.classOf
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.classOfIs
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.classOfIsMulti
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.classicalToStringMethod
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.clone
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.compose
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.concatArrayLikes
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.constrainPointer
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry1
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry2
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry3
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry4
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curry5
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.curryN
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.defineEnumProp
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.defineSubClass
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.defineSubClassPure
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.empty
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.emptyMulti
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.extend
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.extractBoolFromArrayEnd
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.extractBoolFromArrayStart
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.extractFromArrayAt
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.filter.BooleanFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.Filter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.FilterChain
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.SlugFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.StringToLowerFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.StringTrimFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter.StripTagsFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.filter
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.fn
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.forEach
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.forEachInObj
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.generated
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.generated.version
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.getArrayLikes
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.getIterator
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.hasIterator
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.hasMethod
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.implode
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.input.Input
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.input.InputFilter
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.input
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isBoolean
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isEmpty
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isEmptyObj
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isEmptyOrNotOfType
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isFunction
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isNodeEnv
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isNull
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isNumber
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isObject
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isString
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isSymbol
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isUndefined
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.isset
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.issetAndOfType
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.issetMulti
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.iteratorToArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.jsonClone
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.lcaseFirst
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.mapToArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.math
@todo - Added documentation here. Back to other packages and members list.
(m) sjl
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.mergeOnProps
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.mergeOnPropsMulti
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.nodejs.Namespace
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.nodejs
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.notArrayLikeToArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.notEmptyAndOfType
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.ns
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.objToArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.objToArrayMap
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.package
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.restArgs
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.searchObj
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.setToArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.sjl
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.sjlfn
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.stdlib.Config
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.Extendable
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.Iterator
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.ObjectIterator
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.Optionable
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.PriorityList
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.PriorityListItem
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.SjlMap
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.SjlSet
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib.iterable
@todo - Added documentation here. Back to other packages and members list.
(m) sjl.stdlib
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.throwTypeErrorIfEmpty
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.throwTypeErrorIfEmptyOrNotOfType
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.throwTypeErrorIfNotOfType
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.toArray
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.ucaseFirst
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.unConfigurableNamespace
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.unset
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.valueOrDefault
@todo - Added documentation here. Back to sjl direct members and methods list.
(m) sjl.wrapPointer
@todo - Added documentation here. Back to sjl direct members and methods list.
(p) sjl.filter
@todo - Added documentation here. Back to other packages and members list.
(p) sjl.generated
@todo - Added documentation here. Back to other packages and members list.
(p) sjl.input
@todo - Added documentation here. Back to other packages and members list.
(p) sjl.nodejs
@todo - Added documentation here. Back to other packages and members list.
(p) sjl.stdlib
@todo - Added documentation here. Back to other packages and members list.
Unit Tests:
To run unit tests:
1.) First do an npm install
in project root.
2.) For running tests with node: Run one of the following from your terminal:
$ gulp tests
,$ mocha tests/for-server
, or$ npm tests
3.) For running tests in the browser:
- Launch './tests/for-browser/index.html'
- Note
npm install
has to be run prior to running the aforementioned file. - Alternately You can check the tests for this version of the library here: [6.4.x] (http://sjljs.elycruz.com/6.4.x/tests/for-browser) [6.3.x] (http://sjljs.elycruz.com/6.3.x/tests/for-browser) [6.2.x] (http://sjljs.elycruz.com/6.2.x/tests/for-browser) [6.1.x] (http://sjljs.elycruz.com/6.1.x/tests/for-browser) [6.0.x] (http://sjljs.elycruz.com/6.0.x/tests/for-browser) [5.6.34] (http://sjljs.elycruz.com/5.6.34/tests/for-browser) [5.6.0] (http://sjljs.elycruz.com/5.6.0/tests/for-browser) [0.5.18] (http://sjljs.elycruz.com/0.5.18/tests/for-browser) [0.5.17] (http://sjljs.elycruz.com/0.5.17/tests/for-browser) [0.5.15] (http://sjljs.elycruz.com/0.5.15/tests/for-browser)
Requirements:
- Javascript versions ecmascript 5+
Supported Platforms:
Browsers
- IE9+, and all other modern day browsers.
NodeJs
- 4.0.0+
Todos:
MVP for 6.1.0
- -
@todo Include all sub items for components included as sub nav in readme.All docs will now be included in api docs instead (generated with jsdocs). - - @todo Cleanup all jsdocs and ensure all library members are listed there and showing their docs properly/clearly.
- - @todo Ensure all existing constructors and library members have a test file for theirselves.