Skip to content

Commit

Permalink
A tuple type element list cannot be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Apr 4, 2019
1 parent 059463b commit 5f9f590
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libsaml.ts
Expand Up @@ -350,7 +350,7 @@ const libSaml = () => {
metadataCert = [metadataCert];
} else if (metadataCert instanceof Array) {
// flattens the nested array of Certificates from each KeyDescriptor
metadataCert = flattenDeep(metadataCert as []);
metadataCert = flattenDeep(metadataCert);
}
metadataCert = metadataCert.map(utility.normalizeCerString);

Expand Down
4 changes: 2 additions & 2 deletions src/utility.ts
Expand Up @@ -24,7 +24,7 @@ export function zipObject(arr1: string[], arr2: any[]) {
* @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_flattendeep
* @param input {[]}
*/
export function flattenDeep(input: []) {
export function flattenDeep(input: any[]) {
return Array.isArray(input)
? input.reduce( (a, b) => a.concat(flattenDeep(b)) , [])
: [input];
Expand All @@ -34,7 +34,7 @@ export function flattenDeep(input: []) {
* @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_last
* @param input {[]}
*/
export function last(input: []) {
export function last(input: any[]) {
return input.slice(-1)[0];
}
/**
Expand Down

0 comments on commit 5f9f590

Please sign in to comment.