can-view-model
Advanced tools
Comparing version 3.3.0-pre.3 to 3.3.0-pre.4
"use strict"; | ||
var domData = require('can-util/dom/data/data'); | ||
var SimpleMap = require('can-simple-map'); | ||
var domData = require("can-util/dom/data/data"); | ||
var SimpleMap = require("can-simple-map"); | ||
var types = require("can-types"); | ||
var ns = require("can-namespace"); | ||
var getDocument = require("can-util/dom/document/document"); | ||
var isArrayLike = require('can-util/js/is-array-like/is-array-like'); | ||
var isArrayLike = require("can-util/js/is-array-like/is-array-like"); | ||
var canReflect = require("can-reflect"); | ||
module.exports = ns.viewModel = function (el, attr, val) { | ||
var scope ; | ||
if (typeof el === 'string') { | ||
if (typeof el === "string") { | ||
el = getDocument().querySelector(el); | ||
@@ -16,3 +18,3 @@ } else if (isArrayLike(el) && !el.nodeType) { | ||
if (types.isMapLike(attr)) { | ||
if (canReflect.isObservableLike(attr) && canReflect.isMapLike(attr)) { | ||
return domData.set.call( el, "viewModel", attr); | ||
@@ -19,0 +21,0 @@ } |
{ | ||
"name": "can-view-model", | ||
"version": "3.3.0-pre.3", | ||
"version": "3.3.0-pre.4", | ||
"description": "gets or sets the view model of an element", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27677
24
265