UNPKG

1.78 kBSource Map (JSON)View Raw
1{"version":3,"file":"Utilities.js","sourceRoot":"","sources":["../../src/utils/Utilities.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,wEAAqF;AAErF,MAAa,SAAS;IAEpB;;OAEG;IACI,MAAM,CAAC,mBAAmB,CAAC,OAAgB;QAChD,IAAI,2CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;YAChD,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SAC3F;QACD,OAAO,OAAO,CAAC,WAAW,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAY;QAC/C,8CAA8C;QAC9C,iFAAiF;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,CAAC;;AAlBuB,iCAAuB,GAAW,kBAAkB,CAAC;AADlE,8BAAS","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { ApiParameterListMixin, type ApiItem } from '@microsoft/api-extractor-model';\n\nexport class Utilities {\n private static readonly _badFilenameCharsRegExp: RegExp = /[^a-z0-9_\\-\\.]/gi;\n /**\n * Generates a concise signature for a function. Example: \"getArea(width, height)\"\n */\n public static getConciseSignature(apiItem: ApiItem): string {\n if (ApiParameterListMixin.isBaseClassOf(apiItem)) {\n return apiItem.displayName + '(' + apiItem.parameters.map((x) => x.name).join(', ') + ')';\n }\n return apiItem.displayName;\n }\n\n /**\n * Converts bad filename characters to underscores.\n */\n public static getSafeFilenameForName(name: string): string {\n // TODO: This can introduce naming collisions.\n // We will fix that as part of https://github.com/microsoft/rushstack/issues/1308\n return name.replace(Utilities._badFilenameCharsRegExp, '_').toLowerCase();\n }\n}\n"]}
\No newline at end of file