From b543f9cb310be135e8c5fde28acd4eecc3e3be8b Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 23 Jun 2018 12:42:22 +0300 Subject: [PATCH] Update analyze.js --- scripts/analyze.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/analyze.js b/scripts/analyze.js index cbe1286ec..3d535915b 100644 --- a/scripts/analyze.js +++ b/scripts/analyze.js @@ -22,15 +22,15 @@ let snippetTokens = {data: snippetsData.data.map(snippet => { attributes: { codeLength: snippet.attributes.codeBlocks[0].trim().length, tokenCount: tokens.length, - functionCount: tokens.filter(t => t.type == 'function').length, - operatorCount: tokens.filter(t => t.type == 'operator').length, - keywordCount: tokens.filter(t => t.type == 'keyword').length, - distinctFunctionCount: [...new Set(tokens.filter(t => t.type == 'function').map(t => t.content))].length + functionCount: tokens.filter(t => t.type === 'function').length, + operatorCount: tokens.filter(t => t.type === 'operator').length, + keywordCount: tokens.filter(t => t.type === 'keyword').length, + distinctFunctionCount: [...new Set(tokens.filter(t => t.type === 'function').map(t => t.content))].length }, meta: { hash: snippet.meta.hash } - } + }; }), meta: { specification: "http://jsonapi.org/format/"}}; let snippetArchiveTokens = {data: snippetsArchiveData.data.map(snippet => { let tokens = prism.tokenize(snippet.attributes.codeBlocks[0], prism.languages.javascript, 'javascript');