UNPKG

1.14 kBJavaScriptView Raw
1"use strict";
2// export function scope(name: string, namespace: string, separator: string = '-') {
3// return namespace ? namespace + separator + name : name;
4// }
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.deprecated = exports.string2varname = exports.filename2varname = exports.stripQuotation = void 0;
7function stripQuotation(str) {
8 return str.replace(/^['"](.*?)['"]$/g, '$1');
9}
10exports.stripQuotation = stripQuotation;
11function filename2varname(filename) {
12 return string2varname(filename.replace(/(?=.*)\.\w+$/, '').replace(/\.st$/, ''));
13}
14exports.filename2varname = filename2varname;
15function string2varname(str) {
16 return str.replace(/[^0-9a-zA-Z_]/gm, '').replace(/^[^a-zA-Z_]+/gm, '');
17}
18exports.string2varname = string2varname;
19const deprecatedCache = {};
20function deprecated(staticMessage) {
21 if (!deprecatedCache[staticMessage]) {
22 deprecatedCache[staticMessage] = true;
23 try {
24 console.warn('DEPRECATED: ' + staticMessage);
25 }
26 catch {
27 /**/
28 }
29 }
30}
31exports.deprecated = deprecated;
32//# sourceMappingURL=utils.js.map
\No newline at end of file