diff --git a/index.js b/index.js index cc53e8a..3eace79 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ const _ = require('lodash'); const moment = require('moment'); const Symbol = require('es6-symbol/polyfill'); +const getOwnPropertySymbols = require('get-own-property-symbols'); const TWO_DIGITS_MIN_NUMBER = 10; const MAX_MONTH = 12; @@ -135,7 +136,7 @@ function detectTimeType(timeQuery) { const plainTimeQuery = _.isArray(timeQuery) ? _.flatten(timeQuery) : [timeQuery]; const timeTypes = _.uniq(_.flatten( plainTimeQuery - .map(queryDetail => Object.getOwnPropertySymbols(TIME_TYPE_PATTERNS) + .map(queryDetail => getOwnPropertySymbols(TIME_TYPE_PATTERNS) .filter(type => TIME_TYPE_PATTERNS[type].regularExp.test(queryDetail))) )); @@ -209,5 +210,5 @@ exports.getTimeRange = getTimeRange; exports.detectTimeType = detectTimeType; exports.parseTime = parseTime; -exports.TIME_TYPES = Object.getOwnPropertySymbols(TIME_TYPE_PATTERNS); +exports.TIME_TYPES = getOwnPropertySymbols(TIME_TYPE_PATTERNS); exports.TIME_TYPES_AS_STRINGS = exports.TIME_TYPES.map(Symbol.keyFor); diff --git a/package.json b/package.json index baf748d..8b38b30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ddf-time-utils", - "version": "0.1.4", + "version": "0.1.5", "description": "Gapminder DDF time utils", "main": "index.js", "scripts": { @@ -25,6 +25,7 @@ "homepage": "https://github.com/valor-software/ddf-time-utils#readme", "dependencies": { "es6-symbol": "3.1.0", + "get-own-property-symbols": "0.9.2", "lodash": "4.7.0", "moment": "2.14.1" },