UNPKG

@el3um4s/svelte-get-component-info

Version:
19 lines (18 loc) 745 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStringWithoutQuote = exports.isStringType = void 0; function isStringType(s) { const startString = s.trim(); const firstChar = startString.charAt(0); const lastChar = startString.charAt(startString.length - 1); const charIsQuote = firstChar === `"` || firstChar === `'` || firstChar === "`"; const result = charIsQuote && firstChar === lastChar; return result; } exports.isStringType = isStringType; function getStringWithoutQuote(s) { const startString = s.trim(); const result = startString.substring(1, startString.length - 1); return result; } exports.getStringWithoutQuote = getStringWithoutQuote;