Skip to content

Commit

Permalink
throw a deprecation warning for isCoordinate (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin authored and dmarcos committed Jun 9, 2017
1 parent 8aa300c commit 1d4541f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/utils/coordinates.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* global THREE */
var debug = require('./debug');
var extend = require('object-assign');

var warn = debug('utils:coordinates:warn');

// Coordinate string regex. Handles negative, positive, and decimals.
var regex = /^\s*((-?\d*\.{0,1}\d+(e-?\d+)?)\s+){2,3}(-?\d*\.{0,1}\d+(e-?\d+)?)\s*$/;
module.exports.regex = regex;
Expand Down Expand Up @@ -54,8 +58,14 @@ module.exports.stringify = stringify;
/**
* @returns {bool}
*/
module.exports.isCoordinates = function (value) {
function isCoordinates (value) {
return regex.test(value);
}
module.exports.isCoordinates = isCoordinates;

module.exports.isCoordinate = function (value) {
warn('`AFRAME.utils.isCoordinate` has been renamed to `AFRAME.utils.isCoordinates`');
return isCoordinates(value);
};

function vecParseFloat (vec) {
Expand Down

0 comments on commit 1d4541f

Please sign in to comment.