Skip to content

Commit

Permalink
bumping to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zackify committed Aug 2, 2016
1 parent 496abe9 commit c99cb71
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 79 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "immutable-proxy",
"version": "0.0.1",
"version": "0.0.2",
"description": "access immutable values more easily",
"main": "lib/index.js",
"peerDependencies": {
Expand All @@ -25,12 +25,12 @@
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/zackify/fragment.git"
"url": "git+ssh://git@github.com/zackify/immutable-proxy.git"
},
"author": "Zach Silveira",
"license": "ISC",
"bugs": {
"url": "https://github.com/zackify/fragment/issues"
"url": "https://github.com/zackify/immutable-proxy/issues"
},
"homepage": "https://github.com/zackify/fragment#readme"
"homepage": "https://github.com/zackify/immutable-proxy#readme"
}
173 changes: 100 additions & 73 deletions umd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,18 @@ return /******/ (function(modules) { // webpackBootstrap

var _immutable2 = _interopRequireDefault(_immutable);

var _map = __webpack_require__(2);
var _list = __webpack_require__(2);

var _list2 = _interopRequireDefault(_list);

var _map = __webpack_require__(3);

var _map2 = _interopRequireDefault(_map);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = _extends({}, _immutable2.default, {
List: _list2.default,
Map: _map2.default
});

Expand All @@ -88,7 +93,7 @@ return /******/ (function(modules) { // webpackBootstrap
(function (global, factory) {
true ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.Immutable = factory();
(global.Immutable = factory());
}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;

function createClass(ctor, superClass) {
Expand Down Expand Up @@ -983,7 +988,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
return 'Range [ ' +
this._start + '...' + this._end +
(this._step > 1 ? ' by ' + this._step : '') +
(this._step !== 1 ? ' by ' + this._step : '') +
' ]';
};

Expand Down Expand Up @@ -1115,6 +1120,9 @@ return /******/ (function(modules) { // webpackBootstrap
}
var type = typeof o;
if (type === 'number') {
if (o !== o || o === Infinity) {
return 0;
}
var h = o | 0;
if (h !== o) {
h ^= o * 0xFFFFFFFF;
Expand Down Expand Up @@ -1300,6 +1308,17 @@ return /******/ (function(modules) { // webpackBootstrap
});
}

Map.of = function() {var keyValues = SLICE$0.call(arguments, 0);
return emptyMap().withMutations(function(map ) {
for (var i = 0; i < keyValues.length; i += 2) {
if (i + 1 >= keyValues.length) {
throw new Error('Missing value for key: ' + keyValues[i]);
}
map.set(keyValues[i], keyValues[i + 1]);
}
});
};

Map.prototype.toString = function() {
return this.__toString('Map {', '}');
};
Expand Down Expand Up @@ -3212,7 +3231,11 @@ return /******/ (function(modules) { // webpackBootstrap
begin = begin | 0;
}
if (end !== undefined) {
end = end | 0;
if (end === Infinity) {
end = originalSize;
} else {
end = end | 0;
}
}

if (wholeSlice(begin, end, originalSize)) {
Expand Down Expand Up @@ -3749,6 +3772,12 @@ return /******/ (function(modules) { // webpackBootstrap
if (!this.has(k)) {
throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
}
if (this._map && !this._map.has(k)) {
var defaultVal = this._defaultValues[k];
if (v === defaultVal) {
return this;
}
}
var newMap = this._map && this._map.set(k, v);
if (this.__ownerID || newMap === this._map) {
return this;
Expand Down Expand Up @@ -4432,21 +4461,6 @@ return /******/ (function(modules) { // webpackBootstrap
return entry ? entry[1] : notSetValue;
},

findEntry: function(predicate, context) {
var found;
this.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) {
found = [k, v];
return false;
}
});
return found;
},

findLastEntry: function(predicate, context) {
return this.toSeq().reverse().findEntry(predicate, context);
},

forEach: function(sideEffect, context) {
assertNotInfinite(this.size);
return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
Expand Down Expand Up @@ -4557,10 +4571,34 @@ return /******/ (function(modules) { // webpackBootstrap
return this.filter(not(predicate), context);
},

findEntry: function(predicate, context, notSetValue) {
var found = notSetValue;
this.__iterate(function(v, k, c) {
if (predicate.call(context, v, k, c)) {
found = [k, v];
return false;
}
});
return found;
},

findKey: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry && entry[0];
},

findLast: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
},

findLastEntry: function(predicate, context, notSetValue) {
return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
},

findLastKey: function(predicate, context) {
return this.toKeyedSeq().reverse().findKey(predicate, context);
},

first: function() {
return this.find(returnTrue);
},
Expand Down Expand Up @@ -4619,6 +4657,10 @@ return /******/ (function(modules) { // webpackBootstrap
return iter.isSubset(this);
},

keyOf: function(searchValue) {
return this.findKey(function(value ) {return is(value, searchValue)});
},

keySeq: function() {
return this.toSeq().map(keyMapper).toIndexedSeq();
},
Expand All @@ -4627,6 +4669,10 @@ return /******/ (function(modules) { // webpackBootstrap
return this.toSeq().reverse().first();
},

lastKeyOf: function(searchValue) {
return this.toKeyedSeq().reverse().keyOf(searchValue);
},

max: function(comparator) {
return maxFactory(this, comparator);
},
Expand Down Expand Up @@ -4717,35 +4763,6 @@ return /******/ (function(modules) { // webpackBootstrap
IterablePrototype.chain = IterablePrototype.flatMap;
IterablePrototype.contains = IterablePrototype.includes;

// Temporary warning about using length
(function () {
try {
Object.defineProperty(IterablePrototype, 'length', {
get: function () {
if (!Iterable.noLengthWarning) {
var stack;
try {
throw new Error();
} catch (error) {
stack = error.stack;
}
if (stack.indexOf('_wrapObject') === -1) {
console && console.warn && console.warn(
'iterable.length has been deprecated, '+
'use iterable.size or iterable.count(). '+
'This warning will become a silent error in a future version. ' +
stack
);
return this.size;
}
}
}
});
} catch (e) {}
})();



mixin(KeyedIterable, {

// ### More sequential methods
Expand All @@ -4754,23 +4771,6 @@ return /******/ (function(modules) { // webpackBootstrap
return reify(this, flipFactory(this));
},

findKey: function(predicate, context) {
var entry = this.findEntry(predicate, context);
return entry && entry[0];
},

findLastKey: function(predicate, context) {
return this.toSeq().reverse().findKey(predicate, context);
},

keyOf: function(searchValue) {
return this.findKey(function(value ) {return is(value, searchValue)});
},

lastKeyOf: function(searchValue) {
return this.findLastKey(function(value ) {return is(value, searchValue)});
},

mapEntries: function(mapper, context) {var this$0 = this;
var iterations = 0;
return reify(this,
Expand Down Expand Up @@ -4819,16 +4819,13 @@ return /******/ (function(modules) { // webpackBootstrap
},

indexOf: function(searchValue) {
var key = this.toKeyedSeq().keyOf(searchValue);
var key = this.keyOf(searchValue);
return key === undefined ? -1 : key;
},

lastIndexOf: function(searchValue) {
var key = this.toKeyedSeq().reverse().keyOf(searchValue);
var key = this.lastKeyOf(searchValue);
return key === undefined ? -1 : key;

// var index =
// return this.toSeq().reverse().indexOf(searchValue);
},

reverse: function() {
Expand Down Expand Up @@ -4862,8 +4859,8 @@ return /******/ (function(modules) { // webpackBootstrap
// ### More collection methods

findLastIndex: function(predicate, context) {
var key = this.toKeyedSeq().findLastKey(predicate, context);
return key === undefined ? -1 : key;
var entry = this.findLastEntry(predicate, context);
return entry ? entry[0] : -1;
},

first: function() {
Expand Down Expand Up @@ -4904,6 +4901,10 @@ return /******/ (function(modules) { // webpackBootstrap
return reify(this, interleaved);
},

keySeq: function() {
return Range(0, this.size);
},

last: function() {
return this.get(-1);
},
Expand Down Expand Up @@ -4952,6 +4953,7 @@ return /******/ (function(modules) { // webpackBootstrap
});

SetIterable.prototype.has = IterablePrototype.includes;
SetIterable.prototype.contains = SetIterable.prototype.includes;


// Mixin subclasses
Expand Down Expand Up @@ -4988,7 +4990,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

function quoteString(value) {
return typeof value === 'string' ? JSON.stringify(value) : value;
return typeof value === 'string' ? JSON.stringify(value) : String(value);
}

function defaultZipper() {
Expand Down Expand Up @@ -5071,8 +5073,33 @@ return /******/ (function(modules) { // webpackBootstrap

var _immutable = __webpack_require__(1);

exports.default = function (initialData) {
var immutableList = (0, _immutable.List)(initialData);

return new Proxy(immutableList, {
get: function get(proxy, name) {
var immutableName = name === 'length' ? 'size' : name;

return immutableList.get(immutableName) || immutableList[immutableName];
}
});
};

/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

var _immutable = __webpack_require__(1);

exports.default = function (initialData) {
var immutableMap = (0, _immutable.Map)(initialData);

return new Proxy(immutableMap, {
get: function get(proxy, name) {
return immutableMap.get(name) || immutableMap[name];
Expand Down
Loading

0 comments on commit c99cb71

Please sign in to comment.