diff --git a/helpers/app-files-scanner.js b/helpers/app-files-scanner.js index 57a45af..7a8247c 100644 --- a/helpers/app-files-scanner.js +++ b/helpers/app-files-scanner.js @@ -1,6 +1,7 @@ import plist from 'plist' import axios from 'axios' +import { isString } from './type-checks.js' import parseMacho from './macho/index.js' const prettyBytes = require('pretty-bytes') @@ -27,10 +28,6 @@ const knownAppExtensions = new Set([ '.app.zip' ]) -function isString( maybeString ) { - return (typeof maybeString === 'string' || maybeString instanceof String) -} - function isValidHttpUrl( string ) { if ( !isString( string ) ) return false diff --git a/helpers/type-checks.js b/helpers/type-checks.js new file mode 100644 index 0000000..f5f14fe --- /dev/null +++ b/helpers/type-checks.js @@ -0,0 +1,10 @@ + + + +export function isString( maybeString ) { + return (typeof maybeString === 'string' || maybeString instanceof String) +} + +export function isObject( maybeObject ) { + return maybeObject === Object( maybeObject ) +}