compound-ex4
Version:
Compound-ex4 - MVC framework for NodeJS (ExpressJs 4 version), fork compoundjs(https://github.com/1602/compound)
36 lines (29 loc) • 855 B
text/coffeescript
###
A small class to stand-in for a stream when you simply want to write to a string.
###
class @StringStream
constructor: ->
write: (chunk) ->
destination[k] = v for k, v of source for source in sources
destination
return obj.length is 0 if Array.isArray(obj) or typeof obj is 'string'
return false for own key of obj
return true
str = String str
if str.length >= length
str
else if str.length + 1 == length
"#{char}#{str}"
else
"#{new Array(length - str.length + 1).join char}#{str}"
num = num.charCodeAt 0 if typeof num is 'string'
num.toString 16