Comparing version 1.2.0 to 1.2.1
@@ -8,2 +8,6 @@ "use strict"; | ||
var createDocComment_1 = __importDefault(require("./createDocComment")); | ||
var valNameRegExpStr = '^_[a-zA-Z][a-zA-Z0-9_]*'; | ||
var valNameRegExp = new RegExp(valNameRegExpStr); | ||
var valTypeRegExpStr = '(@number|@string)'; | ||
var valTypeRegExp = new RegExp(valTypeRegExpStr); | ||
var toJSValidString = function (text) { | ||
@@ -37,3 +41,3 @@ return text.replace(/[^a-zA-Z0-9$_]/g, '_').replace(/^(\d)/, '$$$1'); | ||
if (hasVal) { | ||
var valPathRegExp = /^_[a-zA-Z][a-zA-Z0-9]*(@number|@string)?((\.|%[0-9a-fA-F]{2})[a-zA-Z0-9]+)?$/; | ||
var valPathRegExp = new RegExp("" + valNameRegExpStr + valTypeRegExpStr + "?((\\.|%[0-9a-fA-F]{2})[a-zA-Z0-9]+)?$"); | ||
if (!valPathRegExp.test(basename)) { | ||
@@ -43,3 +47,3 @@ throw new Error("aspida \u001B[43m\u001B[31mERROR\u001B[0m '" + basename + "' does not match '" + valPathRegExp.toString() + "'."); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
var valName_1 = basename.match(/^_[a-zA-Z][a-zA-Z0-9]*/)[0]; | ||
var valName_1 = basename.match(valNameRegExp)[0]; | ||
var valType = basename.replace(valName_1, '').startsWith('@') | ||
@@ -56,7 +60,7 @@ ? basename.split('@')[1].slice(0, 6) | ||
newUrl = ''; | ||
valFn = "" + indent + valName_1 + (duplicatedNames.length > 1 && valType ? "_" + valType : '') + postfix.replace(/[^a-zA-Z0-9$_]/g, '_') + ": (val" + dirDeps + ": " + (valType !== null && valType !== void 0 ? valType : 'number | string') + ") => {\n" + indent + " const " + newPrefix + " = " + prefixVal + "\n\n" + indent + " return {\n<% next %>\n" + indent + " }\n" + indent + "}"; | ||
valFn = "" + indent + toJSValidString(valName_1) + (duplicatedNames.length > 1 && valType ? "_" + valType : '') + toJSValidString(postfix) + ": (val" + dirDeps + ": " + (valType !== null && valType !== void 0 ? valType : 'number | string') + ") => {\n" + indent + " const " + newPrefix + " = " + prefixVal + "\n\n" + indent + " return {\n<% next %>\n" + indent + " }\n" + indent + "}"; | ||
} | ||
var fallbackSpecialCharsProp = function (text) { | ||
return /%[0-9a-fA-F]{2}/.test(basename) | ||
? text + ",\n" + text.replace(/^( +?)[^ ]+?:/, "$1/**\n$1 * @deprecated `" + toJSValidString(basename.replace(/(@number|@string)/, '')) + "` has been deprecated.\n$1 * Use `" + toJSValidString(decodeURIComponent(basename.replace(/(@number|@string)/, ''))) + "` instead\n$1 */\n$1" + toJSValidString(basename.replace(/(@number|@string)/, '')) + ":") | ||
? text + ",\n" + text.replace(/^( +?)[^ ]+?:/, "$1/**\n$1 * @deprecated `" + toJSValidString(basename.replace(valTypeRegExp, '')) + "` has been deprecated.\n$1 * Use `" + toJSValidString(decodeURIComponent(basename.replace(valTypeRegExp, ''))) + "` instead\n$1 */\n$1" + toJSValidString(basename.replace(valTypeRegExp, '')) + ":") | ||
: text; | ||
@@ -63,0 +67,0 @@ }; |
{ | ||
"name": "aspida", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "Solufa <solufa2020@gmail.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105906
1053