dot.dot.dot.exampol
This commit is contained in:
commit
a0bc2d79de
406 changed files with 34577 additions and 0 deletions
18
node_modules/charm/lib/encode.js
generated
vendored
Normal file
18
node_modules/charm/lib/encode.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
var encode = module.exports = function (xs) {
|
||||
function bytes (s) {
|
||||
if (typeof s === 'string') {
|
||||
return s.split('').map(ord);
|
||||
}
|
||||
else if (Array.isArray(s)) {
|
||||
return s.reduce(function (acc, c) {
|
||||
return acc.concat(bytes(c));
|
||||
}, []);
|
||||
}
|
||||
}
|
||||
|
||||
return new Buffer([ 0x1b ].concat(bytes(xs)));
|
||||
};
|
||||
|
||||
var ord = encode.ord = function ord (c) {
|
||||
return c.charCodeAt(0)
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue