@redocly/graphql-docs
Version:
Redocly GraphQL docs
2 lines (1 loc) • 322 B
JavaScript
import{hasSubHost as n}from"./has-sub-host.js";function i(r,t){return r===t||t.endsWith(`.${r}`)}function e(r,t){return r.some(u=>i(u,t))}function o(r){return e(["localhost","127.0.0.1"],r)}function c(r,t){return t===!0?!0:Array.isArray(t)?o(r)||e(t,r)?!0:t.some(u=>n(u,r)):!1}export{c as isHostAllowed,o as isLocalhost};