UNPKG

@hakit/core

Version:

A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.

3 lines (2 loc) 444 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=[" ",": "," - "],f=(t,o)=>{const r=t.toLowerCase(),i=o.toLowerCase();for(const n of a){const s=`${i}${n}`;if(r.startsWith(s)){const e=t.substring(s.length);if(e.length)return c(e.substr(0,e.indexOf(" ")))?e:e[0].toUpperCase()+e.slice(1)}}},c=t=>t.toLowerCase()!==t;exports.stripPrefixFromEntityName=f; //# sourceMappingURL=stripPrefixFromEntityName.js.map