UNPKG

flashpoint

Version:

Angular bindings for Fireproof. Replaces AngularFire.

25 lines (15 loc) 470 B
angular.module('flashpoint') .factory('fpValidatePath', function() { function fpValidatePath(pathParts) { // check the arguments var path = pathParts.join('/'); if (pathParts.length === 0 || path === '' || pathParts.indexOf(null) !== -1 || pathParts.indexOf(undefined) !== -1) { // if any one of them is null/undefined, this is not a valid path return null; } else { return path; } } return fpValidatePath; });