can-stache-key
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -253,1 +253,6 @@ var observeReader = require("can-stache-key"); | ||
}); | ||
test("it returns null when promise getter is null #2", function(){ | ||
var nullPromise = observeReader.read(null, observeReader.reads('value')); | ||
QUnit.equal(typeof nullPromise,"object"); | ||
}); |
@@ -190,3 +190,3 @@ var Observation = require('can-observation'); | ||
// special reflections. | ||
if(isPromiseLike(value) || typeof value === "object" && typeof value.then === "function") { | ||
if(isPromiseLike(value) || typeof value === "object" && value && typeof value.then === "function") { | ||
canReflectPromise(value); | ||
@@ -193,0 +193,0 @@ } |
@@ -1,3 +0,14 @@ | ||
/*can-stache-key@0.0.2#can-stache-key*/ | ||
define(function (require, exports, module) { | ||
/*can-stache-key@0.0.3#can-stache-key*/ | ||
define([ | ||
'require', | ||
'exports', | ||
'module', | ||
'can-observation', | ||
'can-util/js/dev', | ||
'can-util/js/each', | ||
'can-symbol', | ||
'can-reflect', | ||
'can-util/js/is-promise-like', | ||
'can-reflect-promise' | ||
], function (require, exports, module) { | ||
var Observation = require('can-observation'); | ||
@@ -139,3 +150,3 @@ var dev = require('can-util/js/dev'); | ||
test: function (value) { | ||
if (isPromiseLike(value) || typeof value === 'object' && typeof value.then === 'function') { | ||
if (isPromiseLike(value) || typeof value === 'object' && value && typeof value.then === 'function') { | ||
canReflectPromise(value); | ||
@@ -142,0 +153,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/*can-stache-key@0.0.2#can-stache-key*/ | ||
/*can-stache-key@0.0.3#can-stache-key*/ | ||
var Observation = require('can-observation'); | ||
@@ -138,3 +138,3 @@ var dev = require('can-util/js/dev/dev'); | ||
test: function (value) { | ||
if (isPromiseLike(value) || typeof value === 'object' && typeof value.then === 'function') { | ||
if (isPromiseLike(value) || typeof value === 'object' && value && typeof value.then === 'function') { | ||
canReflectPromise(value); | ||
@@ -141,0 +141,0 @@ } |
@@ -40,2 +40,11 @@ /*[global-shim-start]*/ | ||
}; | ||
var hasCjsDependencies = function(deps) { | ||
return ( | ||
deps[0] === "require" && | ||
deps[1] === "exports" && | ||
deps[2] === "module" | ||
); | ||
}; | ||
var modules = (global.define && global.define.modules) || | ||
@@ -55,8 +64,9 @@ (global._define && global._define.modules) || {}; | ||
// CJS has no dependencies but 3 callback arguments | ||
if(!deps.length && callback.length) { | ||
if (hasCjsDependencies(deps) || (!deps.length && callback.length)) { | ||
module = { exports: {} }; | ||
var require = function(name) { | ||
args[0] = function(name) { | ||
return exports[name] ? get(exports[name]) : modules[name]; | ||
}; | ||
args.push(require, module.exports, module); | ||
args[1] = module.exports; | ||
args[2] = module; | ||
} | ||
@@ -112,4 +122,15 @@ // Babel uses the exports and module object. | ||
) | ||
/*can-stache-key@0.0.2#can-stache-key*/ | ||
define('can-stache-key', function (require, exports, module) { | ||
/*can-stache-key@0.0.3#can-stache-key*/ | ||
define('can-stache-key', [ | ||
'require', | ||
'exports', | ||
'module', | ||
'can-observation', | ||
'can-util/js/dev/dev', | ||
'can-util/js/each/each', | ||
'can-symbol', | ||
'can-reflect', | ||
'can-util/js/is-promise-like/is-promise-like', | ||
'can-reflect-promise' | ||
], function (require, exports, module) { | ||
var Observation = require('can-observation'); | ||
@@ -251,3 +272,3 @@ var dev = require('can-util/js/dev/dev'); | ||
test: function (value) { | ||
if (isPromiseLike(value) || typeof value === 'object' && typeof value.then === 'function') { | ||
if (isPromiseLike(value) || typeof value === 'object' && value && typeof value.then === 'function') { | ||
canReflectPromise(value); | ||
@@ -254,0 +275,0 @@ } |
{ | ||
"name": "can-stache-key", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Read and write keys on a value", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58249
1411
2