Completed
Push — master ( 06507b...6aec3d )
by Felipe
01:55
created

IconObject.toJSON   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 2
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
import { omit } from "./helpers.js";
2
3
function IconObject(canvas, markerOpts) {
4
	this.url = canvas.toDataURL();
5
	this.fillColor = canvas.fillColor;
6
	this.markerOpts = markerOpts;
7
	Object.assign(this, markerOpts);
8
	return this;
9
}
10
11
IconObject.prototype.toJSON = function() {
12
	return omit(this.markerOpts, function(prop) {
13
		return prop.indexOf("gm_") === 0 || prop === "url";
14
	});
15
};
16
17
export { IconObject };
18