spatialillusions / milsymbol

Military Symbols in JavaScript
www.spatialillusions.com/milsymbol
MIT License
544 stars 133 forks source link

isValid returns false #204

Closed r3mi closed 5 years ago

r3mi commented 5 years ago

In my tests, Symbol.isValid seems to always return false. Example:

var ms = require("milsymbol");

var symbol = new ms.Symbol("SFGPUCI----D");
console.log(symbol.isValid(true));
console.log(symbol.isValid());

Result:

{ drawInstructions: false, icon: true, mobility: true }
false

I would expect true for such a valid SIDC. Am I missing something ?

spatialillusions commented 5 years ago

I'm not able to reproduce this at the moment, what version of milsymbol were you using?

r3mi commented 5 years ago

Version 1.3.3 , through NPM

var ms = require("milsymbol");

console.log(ms.getVersion());

var symbol = new ms.Symbol("SFGPUCI----D");
console.log(symbol.isValid(true));
console.log(symbol.isValid());

gives

milsymbol.js 1.3.3 - Copyright (c) 2017 Måns Beckman  http://www.spatialillusions.com
1.3.3
{ drawInstructions: false, icon: true, mobility: true }
false
spatialillusions commented 5 years ago

Fixed in major branch.