Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve() {
- var domElement = (function () {
- function isValidateString(param) {
- var regex = /^[a-z0-9]+$/gi;
- if (typeof (param) !== 'string') {
- return false;
- }
- return regex.test(param);
- }
- var domElement = {
- init: function(type) {
- this.type = type;
- },
- appendChild: function(child) {
- },
- addAttribute: function(name, value) {
- },
- get innerHTML(){
- },
- get type(){
- return this._type;
- },
- set(value){
- if (!isValidateString(value)) {
- throw new Error();
- }
- this._type = value;
- }
- };
- return domElement;
- } ());
- return domElement;
- }
- module.exports = solve;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement