glass-platform
Version:
Glass platform
34 lines (29 loc) • 796 B
JavaScript
(function(){require.register('glass/String',function(module,exports,require){// Generated by CoffeeScript 1.6.2
(function() {
var assert;
Object.merge(String.prototype, {
isId: function() {
return /^[^\d\W]\w*$/.test(this);
}
});
if (typeof describe === 'function') {
assert = require('assert');
describe('String', function() {
return describe('#isId', function() {
it("should match foo", function() {
return assert("foo".isId());
});
it("should not match <foo>", function() {
return assert(!"<foo>".isId());
});
return it("should not match 2foo", function() {
return assert(!"2foo".isId());
});
});
});
}
}).call(this);
/*
//@ sourceMappingURL=String.map
*/
})})()