This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community.
Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it.
https://www.freifunk-altdorf.de
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
613 B
17 lines
613 B
var toInteger = require('./$.to-integer') |
|
, defined = require('./$.defined'); |
|
// true -> String#at |
|
// false -> String#codePointAt |
|
module.exports = function(TO_STRING){ |
|
return function(that, pos){ |
|
var s = String(defined(that)) |
|
, i = toInteger(pos) |
|
, l = s.length |
|
, a, b; |
|
if(i < 0 || i >= l)return TO_STRING ? '' : undefined; |
|
a = s.charCodeAt(i); |
|
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff |
|
? TO_STRING ? s.charAt(i) : a |
|
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; |
|
}; |
|
}; |