UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 812 B
var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(t,r)=>{for(var u in r)n(t,u,{get:r[u],enumerable:!0})},H=(t,r,u,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of s(r))!a.call(t,e)&&e!==u&&n(t,e,{get:()=>r[e],enumerable:!(i=l(r,e))||i.enumerable});return t};var p=t=>H(n({},"__esModule",{value:!0}),t);var y={};d(y,{isHostAllowed:()=>x,isLocalhost:()=>c});module.exports=p(y);var f=require("./has-sub-host");function A(t,r){return t===r||r.endsWith(`.${t}`)}function o(t,r){return t.some(u=>A(u,r))}function c(t){return o(["localhost","127.0.0.1"],t)}function x(t,r){return r===!0?!0:Array.isArray(r)?c(t)||o(r,t)?!0:r.some(u=>(0,f.hasSubHost)(u,t)):!1}0&&(module.exports={isHostAllowed,isLocalhost});