1Elm.Native.JavaScript = {};
2Elm.Native.JavaScript.make = function(elm) {
3 elm.Native = elm.Native || {};
4 elm.Native.JavaScript = elm.Native.JavaScript || {};
5 if (elm.Native.JavaScript.values) return elm.Native.JavaScript.values;
7 var List = Elm.Native.List.make(elm);
8 var Render = ElmRuntime.use(ElmRuntime.Render.Element);
12 if (type === 'number' ) return v;
13 if (type === 'boolean') return v;
14 if (type === 'string' ) return v;
15 if (v instanceof Array) {
18 for (var i = 0; i < len; ++i) {
20 if (x !== null) arr.push(x);
22 return List.fromArray(arr);
24 if (type === 'object') {
28 if (x !== null) rec[f] = x;
37 if (type === 'number' || type === 'boolean' || type === 'string') return v;
38 if (type === 'object' && '_' in v) {
42 if (x !== null) obj[k] = x;
46 if (type === 'object' && (v.ctor === '::' || v.ctor === '[]')) {
47 var array = List.toArray(v);
48 for (var i = array.length; i--; ) {
49 array[i] = toJS(array[i]);
56 function fromRecord(r) {
57 if (typeof r === 'object' && '_' in r) {
60 throw new Error("'fromRecord' must be called on a record.");
63 return elm.Native.JavaScript.values = {
65 fromRecord : fromRecord
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list