mirror of
https://github.com/gradle/wrapper-validation-action
synced 2024-11-23 17:22:01 +00:00
Replace homoglyphs.ts with unhomoglyph library
This commit is contained in:
parent
ae0da6528c
commit
e4429f250f
6 changed files with 49 additions and 4090 deletions
2069
dist/index.js
vendored
2069
dist/index.js
vendored
File diff suppressed because one or more lines are too long
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -6180,6 +6180,11 @@
|
|||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
|
||||
"integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI="
|
||||
},
|
||||
"unhomoglyph": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.3.tgz",
|
||||
"integrity": "sha512-PC/OAHE8aiTK0Gfmy0PxOlePazRn+BeCM1r4kFtkHgEnkJZgJoI7yD2yUEjsfSdLXKU1FSt/EcIZvNoKazYUTw=="
|
||||
},
|
||||
"union-value": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.0",
|
||||
"typed-rest-client": "^1.7.1"
|
||||
"typed-rest-client": "^1.7.1",
|
||||
"unhomoglyph": "^1.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^24.0.23",
|
||||
|
|
4
src/declarations.d.ts
vendored
Normal file
4
src/declarations.d.ts
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
declare module 'unhomoglyph' {
|
||||
function unhomoglyph(input: string): string
|
||||
export = unhomoglyph
|
||||
}
|
|
@ -1,18 +1,14 @@
|
|||
import * as util from 'util'
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
|
||||
import * as homoglyphs from './homoglyphs'
|
||||
import unhomoglyph from 'unhomoglyph'
|
||||
|
||||
const readdir = util.promisify(fs.readdir)
|
||||
|
||||
export async function findWrapperJars(baseDir: string): Promise<string[]> {
|
||||
const targetWords = ['gradle-wrapper.jar']
|
||||
const files = await recursivelyListFiles(baseDir)
|
||||
return files
|
||||
.filter(
|
||||
file => homoglyphs.search(path.basename(file), targetWords).length > 0
|
||||
)
|
||||
.filter(file => unhomoglyph(file).endsWith('gradle-wrapper.jar'))
|
||||
.map(wrapperJar => path.relative(baseDir, wrapperJar))
|
||||
}
|
||||
|
||||
|
|
2050
src/homoglyphs.ts
2050
src/homoglyphs.ts
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue