From 8fb7e29a70836fbbad540eb060989f0161f6773e Mon Sep 17 00:00:00 2001 From: Shahar Soel Date: Sat, 2 Jan 2016 23:00:14 +0200 Subject: [PATCH] Remove usage of _.keys. relates to #68 --- src/lang/lang_extensions.ts | 2 +- src/parse/grammar/lookahead.ts | 2 +- src/utils/utils.ts | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lang/lang_extensions.ts b/src/lang/lang_extensions.ts index 4f4d409bc..d85585f58 100644 --- a/src/lang/lang_extensions.ts +++ b/src/lang/lang_extensions.ts @@ -37,7 +37,7 @@ namespace chevrotain.lang { private _state = {} keys():string[] { - return _.keys(this._state) + return utils.keys(this._state) } values():V[] { diff --git a/src/parse/grammar/lookahead.ts b/src/parse/grammar/lookahead.ts index 6d867f044..59705ab6e 100644 --- a/src/parse/grammar/lookahead.ts +++ b/src/parse/grammar/lookahead.ts @@ -121,7 +121,7 @@ namespace chevrotain.lookahead { }) }) - let altsIndicesTokenAppearsIn = _.map(_.keys(altsCurrTokenAppearsIn), (index) => { + let altsIndicesTokenAppearsIn = _.map(utils.keys(altsCurrTokenAppearsIn), (index) => { return parseInt(index, 10) + 1 }) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index afe98ded8..13f579552 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -13,4 +13,8 @@ namespace utils { export function isEmpty(arr:any[]) { return arr.length === 0 } + + export function keys(obj:any) { + return Object.keys(obj) + } }