FLUJOS/BACK_BACK/node_modules/is-html/index.js
2025-11-07 00:06:12 +01:00

16 lines
337 B
JavaScript
Executable file

'use strict';
var htmlTags = require('html-tags');
var basic = /\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i;
var full = new RegExp(htmlTags.map(function (el) {
return '<' + el + '\\b[^>]*>';
}).join('|'), 'i');
module.exports = function (str) {
if (basic.test(str)) {
return true;
}
return full.test(str);
};