Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mujica committed Sep 30, 2019
1 parent 1226eae commit b2cca30
Show file tree
Hide file tree
Showing 3 changed files with 303 additions and 0 deletions.
48 changes: 48 additions & 0 deletions dist/amd/can-value.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*can-value@1.1.1#can-value*/
define([
'require',
'exports',
'module',
'can-key',
'can-reflect',
'can-simple-observable/key',
'can-namespace',
'can-observation',
'can-simple-observable',
'can-simple-observable/settable'
], function (require, exports, module) {
'use strict';
var canKey = require('can-key');
var canReflect = require('can-reflect');
var keyObservable = require('can-simple-observable/key');
var namespace = require('can-namespace');
var Observation = require('can-observation');
var SimpleObservable = require('can-simple-observable');
var SettableObservable = require('can-simple-observable/settable');
module.exports = namespace.value = {
bind: function (object, keyPath) {
return keyObservable(object, keyPath);
},
from: function (object, keyPath) {
var observationFunction = function () {
return canKey.get(object, keyPath);
};
return new Observation(observationFunction);
},
returnedBy: function (getter, context, initialValue) {
if (getter.length === 1) {
return new SettableObservable(getter, context, initialValue);
} else {
return new Observation(getter, context);
}
},
to: function (object, keyPath) {
var observable = keyObservable(object, keyPath);
var symbolsToAssign = { 'can.getValue': null };
return canReflect.assignSymbols(observable, symbolsToAssign);
},
with: function (initialValue) {
return new SimpleObservable(initialValue);
}
};
});
35 changes: 35 additions & 0 deletions dist/cjs/can-value.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*can-value@1.1.1#can-value*/
'use strict';
var canKey = require('can-key');
var canReflect = require('can-reflect');
var keyObservable = require('can-simple-observable/key/key');
var namespace = require('can-namespace');
var Observation = require('can-observation');
var SimpleObservable = require('can-simple-observable');
var SettableObservable = require('can-simple-observable/settable/settable');
module.exports = namespace.value = {
bind: function (object, keyPath) {
return keyObservable(object, keyPath);
},
from: function (object, keyPath) {
var observationFunction = function () {
return canKey.get(object, keyPath);
};
return new Observation(observationFunction);
},
returnedBy: function (getter, context, initialValue) {
if (getter.length === 1) {
return new SettableObservable(getter, context, initialValue);
} else {
return new Observation(getter, context);
}
},
to: function (object, keyPath) {
var observable = keyObservable(object, keyPath);
var symbolsToAssign = { 'can.getValue': null };
return canReflect.assignSymbols(observable, symbolsToAssign);
},
with: function (initialValue) {
return new SimpleObservable(initialValue);
}
};
220 changes: 220 additions & 0 deletions dist/global/can-value.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
/*[process-shim]*/
(function(global, env) {
// jshint ignore:line
if (typeof process === "undefined") {
global.process = {
argv: [],
cwd: function() {
return "";
},
browser: true,
env: {
NODE_ENV: env || "development"
},
version: "",
platform:
global.navigator &&
global.navigator.userAgent &&
/Windows/.test(global.navigator.userAgent)
? "win"
: ""
};
}
})(
typeof self == "object" && self.Object == Object
? self
: typeof process === "object" &&
Object.prototype.toString.call(process) === "[object process]"
? global
: window,
"development"
);

/*[global-shim-start]*/
(function(exports, global, doEval) {
// jshint ignore:line
var origDefine = global.define;

var get = function(name) {
var parts = name.split("."),
cur = global,
i;
for (i = 0; i < parts.length; i++) {
if (!cur) {
break;
}
cur = cur[parts[i]];
}
return cur;
};
var set = function(name, val) {
var parts = name.split("."),
cur = global,
i,
part,
next;
for (i = 0; i < parts.length - 1; i++) {
part = parts[i];
next = cur[part];
if (!next) {
next = cur[part] = {};
}
cur = next;
}
part = parts[parts.length - 1];
cur[part] = val;
};
var useDefault = function(mod) {
if (!mod || !mod.__esModule) return false;
var esProps = { __esModule: true, default: true };
for (var p in mod) {
if (!esProps[p]) return false;
}
return true;
};

var hasCjsDependencies = function(deps) {
return (
deps[0] === "require" && deps[1] === "exports" && deps[2] === "module"
);
};

var modules =
(global.define && global.define.modules) ||
(global._define && global._define.modules) ||
{};
var ourDefine = (global.define = function(moduleName, deps, callback) {
var module;
if (typeof deps === "function") {
callback = deps;
deps = [];
}
var args = [],
i;
for (i = 0; i < deps.length; i++) {
args.push(
exports[deps[i]]
? get(exports[deps[i]])
: modules[deps[i]] || get(deps[i])
);
}
// CJS has no dependencies but 3 callback arguments
if (hasCjsDependencies(deps) || (!deps.length && callback.length)) {
module = { exports: {} };
args[0] = function(name) {
return exports[name] ? get(exports[name]) : modules[name];
};
args[1] = module.exports;
args[2] = module;
} else if (!args[0] && deps[0] === "exports") {
// Babel uses the exports and module object.
module = { exports: {} };
args[0] = module.exports;
if (deps[1] === "module") {
args[1] = module;
}
} else if (!args[0] && deps[0] === "module") {
args[0] = { id: moduleName };
}

global.define = origDefine;
var result = callback ? callback.apply(null, args) : undefined;
global.define = ourDefine;

// Favor CJS module.exports over the return value
result = module && module.exports ? module.exports : result;
modules[moduleName] = result;

// Set global exports
var globalExport = exports[moduleName];
if (globalExport && !get(globalExport)) {
if (useDefault(result)) {
result = result["default"];
}
set(globalExport, result);
}
});
global.define.orig = origDefine;
global.define.modules = modules;
global.define.amd = true;
ourDefine("@loader", [], function() {
// shim for @@global-helpers
var noop = function() {};
return {
get: function() {
return { prepareGlobal: noop, retrieveGlobal: noop };
},
global: global,
__exec: function(__load) {
doEval(__load.source, global);
}
};
});
})(
{},
typeof self == "object" && self.Object == Object
? self
: typeof process === "object" &&
Object.prototype.toString.call(process) === "[object process]"
? global
: window,
function(__$source__, __$global__) {
// jshint ignore:line
eval("(function() { " + __$source__ + " \n }).call(__$global__);");
}
);

/*can-value@1.1.1#can-value*/
define('can-value', [
'require',
'exports',
'module',
'can-key',
'can-reflect',
'can-simple-observable/key/key',
'can-namespace',
'can-observation',
'can-simple-observable',
'can-simple-observable/settable/settable'
], function (require, exports, module) {
'use strict';
var canKey = require('can-key');
var canReflect = require('can-reflect');
var keyObservable = require('can-simple-observable/key/key');
var namespace = require('can-namespace');
var Observation = require('can-observation');
var SimpleObservable = require('can-simple-observable');
var SettableObservable = require('can-simple-observable/settable/settable');
module.exports = namespace.value = {
bind: function (object, keyPath) {
return keyObservable(object, keyPath);
},
from: function (object, keyPath) {
var observationFunction = function () {
return canKey.get(object, keyPath);
};
return new Observation(observationFunction);
},
returnedBy: function (getter, context, initialValue) {
if (getter.length === 1) {
return new SettableObservable(getter, context, initialValue);
} else {
return new Observation(getter, context);
}
},
to: function (object, keyPath) {
var observable = keyObservable(object, keyPath);
var symbolsToAssign = { 'can.getValue': null };
return canReflect.assignSymbols(observable, symbolsToAssign);
},
with: function (initialValue) {
return new SimpleObservable(initialValue);
}
};
});
/*[global-shim-end]*/
(function(global) { // jshint ignore:line
global._define = global.define;
global.define = global.define.orig;
}
)(typeof self == "object" && self.Object == Object ? self : (typeof process === "object" && Object.prototype.toString.call(process) === "[object process]") ? global : window);

0 comments on commit b2cca30

Please sign in to comment.