Code coverage report for src/sfPath.js

Statements: 84.62% (11 / 13)      Branches: 50% (4 / 8)      Functions: 75% (3 / 4)      Lines: 84.62% (11 / 13)      Ignored: none     

All files » src/ » sfPath.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291   46     46         46         46 18       46 46 46   46 36      
angular.module('schemaForm').provider('sfPath',
[function() {
  var sfPath = {parse: ObjectPath.parse};
 
  // if we're on Angular 1.2.x, we need to continue using dot notation
  Iif (angular.version.major === 1 && angular.version.minor < 3) {
    sfPath.stringify = function(arr) {
      return Array.isArray(arr) ? arr.join('.') : arr.toString();
    };
  } else {
    sfPath.stringify = ObjectPath.stringify;
  }
 
  // We want this to use whichever stringify method is defined above,
  // so we have to copy the code here.
  sfPath.normalize = function(data, quote) {
    return sfPath.stringify(Array.isArray(data) ? data : sfPath.parse(data), quote);
  };
 
  // expose the methods in sfPathProvider
  this.parse = sfPath.parse;
  this.stringify = sfPath.stringify;
  this.normalize = sfPath.normalize;
 
  this.$get = function() {
    return sfPath;
  };
}]);