ts-string-extractor
Advanced tools
Comparing version
@@ -55,3 +55,3 @@ "use strict"; | ||
} | ||
return keys; | ||
return uniqSorted(keys); | ||
} | ||
@@ -62,3 +62,3 @@ function subKeysFromObjectLiteral(node) { | ||
for (const prop of node.properties) { | ||
if (typescript_1.default.isPropertyAssignment(prop)) { | ||
if (typescript_1.default.isPropertyAssignment(prop) || typescript_1.default.isShorthandPropertyAssignment(prop)) { | ||
if (typescript_1.default.isIdentifier(prop.name) || typescript_1.default.isStringLiteral(prop.name)) { | ||
@@ -70,3 +70,3 @@ keys.push(prop.name.text); | ||
} | ||
return keys; | ||
return uniqSorted(keys); | ||
} | ||
@@ -76,1 +76,6 @@ function listsEqualUnordered(a, b) { | ||
} | ||
function uniqSorted(list) { | ||
list = [...new Set(list)]; | ||
list.sort(); | ||
return list; | ||
} |
{ | ||
"name": "ts-string-extractor", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Extracts the string literal contents of TypeScript function calls", | ||
@@ -31,2 +31,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "18.15.11", | ||
"prettier": "2.8.7", | ||
@@ -33,0 +34,0 @@ "typescript": "5.0.4" |
8714
4.15%6
20%159
7.43%3
50%