Skip to content

Commit

Permalink
fix getOwnPropertySymbols
Browse files Browse the repository at this point in the history
buchslava committed Sep 20, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d3252a4 commit d135346
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -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);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
},

0 comments on commit d135346

Please sign in to comment.