0.2.1
All methods take a lot of arguments. Each type is matched, depending on the function.
a.number 17, 1991 # true
a.string "isnovid", "a", "coffeescript", "javascript" # true
Many methods have aliases, made for beauty.
a.string "isnovid" # true
a.strings "a", "coffeescript", "javascript" # true
Each version is published in the NPM repository.
npm install isnovid.a
git clone git://github.com/isnovid/isnovid.a.git
Server: A = require "isnovid.a"
Client: A = isnovid.A
Does not accept arguments.
In the future it will be possible to accept the configuration.
a.null``a.nulls
a.nulls null, null, null # true
a.null 0 # false
a.undefined``a.undefineds
a.undefineds undefined, undefined, undefined # true
a.boolean``a.booleans
a.booleans true, false, true # true
a.number``a.numbers
a.numbers 17, 1991 # true
a.number NaN # false
a.number null # false
a.string``a.strings
a.strings "isnovid","a" # true
a.object``a.objects
a.objects {}, [], (->), /(\w+)\s(\w+)/ # true
a.object null # false
a.object undefined # false
a.array``a.arrays
a.arrays [], [1,2], [1..10] # true
a.array arguments # false
a.array {} # false
a.function``a.functions
a.functions ( -> ), class, -> # true
a.function new -> # false
a.function new class # false
a.arguments
a.arguments arguments # true
a.arguments {} # false
a.arguments [] # false
a.date
,a.dates
a.date new Date # true
a.element``a.arguments
a.element document.getElementById('project') # true
a.finite``a.finities
a.finite 17 # true
a.finite Infinity # false
a.nan``a.NaN``a.Nan
a.nan NaN # true
a.reg``a.regex``a.regexp``a.regExp``a.RegExp``a.regularExpression
a.reg /(\w+)\s(\w+)/ # true
a.empty``a.empties
a.empties "", 0, [], {}, ->, null, undefined # true
a.empty [1..10] # false
a.equal``a.equals
a.equal {name:"isnovid.a"},{name:"isnovid.a"},{name:"isnovid.a"} # true
a.equals (-> true),(-> true),(-> true) # true
a.of``a.instanceof
With coffeescript classes.
B = class
b = new B
C = class extends B
c = new C
a.of c,b,B # true
With standart function prototype.
B = ->
b = new B
C = ->
C.prototype = b
c = new C
a.of c,b,B # true
Sometimes you need to do a complex operation in the condition does not fit into a standard system of cycles. Also, loops embedded in the library used immediately logic conditions "and" and "or", which allows greatly simplify the code. Logical "or", executes the handler until until it returns true. Otherwise, the cycle will return false. Logical "or", executes the handler until until it returns true. Otherwise, the cycle will return false.
a.or 4, (count) -> count is 2 # true
a.and 4, (count) -> count < 2 # false
a.or { a: 1, b: 2 }, (value, key) -> a.number value # true
a.and { a: 1, b: 2 }, (value, key) -> a.number value # true
a.or a.string, a.number, (method) -> method "string" # true
a.and [1..10]..., (value,key) -> a.number value # true
a.has
,a.key
,a.keys
data =
b: null
c: undefined
d: true
a.keys data,"b","c","d" # true
a.keys data,"b","c","f" # false