Comparing version 2.1.0 to 2.1.1
@@ -145,8 +145,7 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.F = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
function downPathU(path, z) { | ||
var downPath = exports.downPath = (0, _infestines.curry)(function (path, z) { | ||
for (var i = 0, n = path.length; z && i < n; ++i) { | ||
z = downToU(path[i], z); | ||
}return z; | ||
} | ||
var downPath = exports.downPath = (0, _infestines.curry)(downPathU); | ||
}); | ||
@@ -235,6 +234,6 @@ var downMost = function downMost(head) { | ||
while (z && (0, _infestines.isDefined)(z.key)) { | ||
path.unshift(z.key); | ||
path.push(z.key); | ||
z = z.up; | ||
} | ||
return path; | ||
return path.reverse(); | ||
} | ||
@@ -244,2 +243,2 @@ | ||
}); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvZmFzdGVuZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7UUNrR2dCLEUsR0FBQSxFO1FBOERBLEksR0FBQSxJO1FBQ0EsSSxHQUFBLEk7UUFJQSxVLEdBQUEsVTtRQXdCQSxNLEdBQUEsTTs7QUE3T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d2hlcmVHKGYpLCBldmVyeXdoZXJlVShmLCB6KSlcbmNvbnN0IGV2ZXJ5d2hlcmVVID0gKGYsIHopID0+XG4gIG1vZGlmeVUoZiwgdHJhbnNmb3JtTW92ZVUoZG93bkhlYWQsIGV2ZXJ5d2hlcmVHKGYpLCB6KSlcbmV4cG9ydCBjb25zdCBldmVyeXdoZXJlID0gY3VycnkoZXZlcnl3aGVyZVUpXG5cbmV4cG9ydCBmdW5jdGlvbiBwYXRoT2Yoeikge1xuICBjb25zdCBwYXRoID0gW11cbiAgd2hpbGUgKHogJiYgaXNEZWZpbmVkKHoua2V5KSkge1xuICAgIHBhdGgucHVzaCh6LmtleSlcbiAgICB6ID0gei51cFxuICB9XG4gIHJldHVybiBwYXRoLnJldmVyc2UoKVxufVxuIl19 |
@@ -1,5 +0,1 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.F = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
"use strict";function firstKey(e){for(var r in e)return r}function lastKey(e){var r=void 0;for(var t in e)r=t;return r}function reverse(e){for(var r=null;e;)r=3===e.length?[r,e[1],e[2]]:[r,e[1]],e=e[0];return r}function intoObject(e,r){for(;e;)r[e[2]]=e[1],e=e[0]}function fromObject(e,r,t){var n=null,o=null,i=void 0;for(var s in e)(0,_infestines.isDefined)(i)?o=[o,e[s],s]:r===s?i=e[s]:n=[n,e[s],s];return zipper(n,i,r,reverse(o),t)}function intoArray(e,r){for(;e;)r.push(e[1]),e=e[0]}function fromArray(e,r,t){for(var n=null,o=null,i=0;i<r;++i)n=[n,e[i]];for(var s=e.length-1;r<s;--s)o=[o,e[s]];return zipper(n,e[r],r,o,t)}function up(e){var r=e.left,t=e.focus,n=e.key,o=e.right,i=e.up;switch(typeof n){case"number":var s=[];return intoArray(reverse(r),s),(0,_infestines.isDefined)(t)&&s.push(t),intoArray(o,s),(0,_infestines.assocPartialU)("focus",s,i);case"string":var f={};return intoObject(reverse(r),f),(0,_infestines.isDefined)(t)&&(f[n]=t),intoObject(o,f),(0,_infestines.assocPartialU)("focus",f,i)}}function downToU(e,r){var t=r.focus;return(0,_infestines.isObject)(t)&&isString(e)&&e in t?fromObject(t,e,(0,_infestines.dissocPartialU)("focus",r)):(0,_infestines.isArray)(t)&&isNumber(e)&&0<=e&&e<t.length?fromArray(t,e,(0,_infestines.dissocPartialU)("focus",r)):void 0}function downPathU(e,r){for(var t=0,n=e.length;r&&t<n;++t)r=downToU(e[t],r);return r}function head(e){var r=up(e);return r&&downHead(r)}function last(e){var r=up(e);return r&&downLast(r)}function fromZipper(e){var r=up(e);return r?fromZipper(r):get(e)}function queryMoveU(e,r,t,n){var o=e(n);return o?t(o):r}function bwd(e,r){switch(e){case left:return right;case right:return left;case up:return downTo(keyOf(r));default:return up}}function pathOf(e){for(var r=[];e&&(0,_infestines.isDefined)(e.key);)r.unshift(e.key),e=e.up;return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.everywhere=exports.transformMove=exports.queryMove=exports.toZipper=exports.right=exports.left=exports.downLast=exports.downHead=exports.downPath=exports.downTo=exports.modify=exports.set=exports.keyOf=exports.get=void 0,exports.up=up,exports.head=head,exports.last=last,exports.fromZipper=fromZipper,exports.pathOf=pathOf;var _infestines=require("infestines"),isString=function(e){return"string"==typeof e},isNumber=function(e){return"number"==typeof e},zipper=function(e,r,t,n,o){return(0,_infestines.isDefined)(o)?{left:e,focus:r,key:t,right:n,up:o}:{left:e,focus:r,key:t,right:n}},get=exports.get=function(e){return e.focus},keyOf=exports.keyOf=function(e){return e.key},setU=function(e,r){return(0,_infestines.assocPartialU)("focus",e,r)},set=exports.set=(0,_infestines.curry)(setU),modifyU=function(e,r){return setU(e(get(r)),r)},modify=exports.modify=(0,_infestines.curry)(modifyU),downTo=exports.downTo=(0,_infestines.curry)(downToU),downPath=exports.downPath=(0,_infestines.curry)(downPathU),downMost=function(e){return function(r){var t=r.focus;return(0,_infestines.isObject)(t)?downToU(e?firstKey(t):lastKey(t),r):(0,_infestines.isArray)(t)?downToU(e?0:t.length-1,r):void 0}},downHead=exports.downHead=downMost(!0),downLast=exports.downLast=downMost(!1),left=exports.left=function e(r){var e=r.left,t=r.focus,n=r.key,o=r.right,i=r.up;return e?isNumber(n)?zipper(e[0],e[1],n-1,[o,t],i):zipper(e[0],e[1],e[2],[o,t,n],i):void 0},right=exports.right=function e(r){var t=r.left,n=r.focus,o=r.key,e=r.right,i=r.up;return e?isNumber(o)?zipper([t,n],e[1],o+1,e[0],i):zipper([t,n,o],e[1],e[2],e[0],i):void 0},toZipper=exports.toZipper=function(e){return{focus:e}},queryMove=exports.queryMove=(0,_infestines.curry)(queryMoveU),transformMoveU=function(e,r,t){return queryMoveU(e,t,function(n){return queryMoveU(bwd(e,t),t,_infestines.id,r(n))},t)},transformMove=exports.transformMove=(0,_infestines.curry)(transformMoveU),everywhereG=function e(r){return function(t){return transformMoveU(right,e(r),everywhereU(r,t))}},everywhereU=function(e,r){return modifyU(e,transformMoveU(downHead,everywhereG(e),r))},everywhere=exports.everywhere=(0,_infestines.curry)(everywhereU); | ||
},{"infestines":undefined}]},{},[1])(1) | ||
}); | ||
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.F=r()}}(function(){return function r(n,e,t){function u(i,f){if(!e[i]){if(!n[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(o)return o(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var a=e[i]={exports:{}};n[i][0].call(a.exports,function(r){var e=n[i][1][r];return u(e?e:r)},a,a.exports,r,n,e,t)}return e[i].exports}for(var o="function"==typeof require&&require,i=0;i<t.length;i++)u(t[i]);return u}({1:[function(r,n,e){"use strict";function t(r){for(var n in r)return n}function u(r){var n=void 0;for(var e in r)n=e;return n}function o(r){for(var n=null;r;)n=3===r.length?[n,r[1],r[2]]:[n,r[1]],r=r[0];return n}function i(r,n){for(;r;)n[r[2]]=r[1],r=r[0]}function f(r,n,e){var t=null,u=null,i=void 0;for(var f in r)(0,w.isDefined)(i)?u=[u,r[f],f]:n===f?i=r[f]:t=[t,r[f],f];return O(t,i,n,o(u),e)}function c(r,n){for(;r;)n.push(r[1]),r=r[0]}function s(r,n,e){for(var t=null,u=null,o=0;o<n;++o)t=[t,r[o]];for(var i=r.length-1;n<i;--i)u=[u,r[i]];return O(t,r[n],n,u,e)}function a(r){var n=r.left,e=r.focus,t=r.key,u=r.right,f=r.up;switch(typeof t){case"number":var s=[];return c(o(n),s),(0,w.isDefined)(e)&&s.push(e),c(u,s),(0,w.assocPartialU)("focus",s,f);case"string":var a={};return i(o(n),a),(0,w.isDefined)(e)&&(a[t]=e),i(u,a),(0,w.assocPartialU)("focus",a,f)}}function d(r,n){var e=n.focus;return(0,w.isObject)(e)&&m(r)&&r in e?f(e,r,(0,w.dissocPartialU)("focus",n)):(0,w.isArray)(e)&&k(r)&&0<=r&&r<e.length?s(e,r,(0,w.dissocPartialU)("focus",n)):void 0}function l(r){var n=a(r);return n&&M(n)}function v(r){var n=a(r);return n&&j(n)}function y(r){var n=a(r);return n?y(n):b(r)}function p(r,n,e,t){var u=r(t);return u?e(u):n}function h(r,n){switch(r){case _:return L;case L:return _;case a:return q(P(n));default:return a}}function g(r){for(var n=[];r&&(0,w.isDefined)(r.key);)n.push(r.key),r=r.up;return n.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.everywhere=e.transformMove=e.queryMove=e.toZipper=e.right=e.left=e.downLast=e.downHead=e.downPath=e.downTo=e.modify=e.set=e.keyOf=e.get=void 0,e.up=a,e.head=l,e.last=v,e.fromZipper=y,e.pathOf=g;var w=r("infestines"),m=function(r){return"string"==typeof r},k=function(r){return"number"==typeof r},O=function(r,n,e,t,u){return(0,w.isDefined)(u)?{left:r,focus:n,key:e,right:t,up:u}:{left:r,focus:n,key:e,right:t}},b=e.get=function(r){return r.focus},P=e.keyOf=function(r){return r.key},D=function(r,n){return(0,w.assocPartialU)("focus",r,n)},U=(e.set=(0,w.curry)(D),function(r,n){return D(r(b(n)),n)}),q=(e.modify=(0,w.curry)(U),e.downTo=(0,w.curry)(d)),x=(e.downPath=(0,w.curry)(function(r,n){for(var e=0,t=r.length;n&&e<t;++e)n=d(r[e],n);return n}),function(r){return function(n){var e=n.focus;return(0,w.isObject)(e)?d(r?t(e):u(e),n):(0,w.isArray)(e)?d(r?0:e.length-1,n):void 0}}),M=e.downHead=x(!0),j=e.downLast=x(!1),_=e.left=function r(n){var r=n.left,e=n.focus,t=n.key,u=n.right,o=n.up;return r?k(t)?O(r[0],r[1],t-1,[u,e],o):O(r[0],r[1],r[2],[u,e,t],o):void 0},L=e.right=function r(n){var e=n.left,t=n.focus,u=n.key,r=n.right,o=n.up;return r?k(u)?O([e,t],r[1],u+1,r[0],o):O([e,t,u],r[1],r[2],r[0],o):void 0},T=(e.toZipper=function(r){return{focus:r}},e.queryMove=(0,w.curry)(p),function(r,n,e){return p(r,e,function(t){return p(h(r,e),e,w.id,n(t))},e)}),Z=(e.transformMove=(0,w.curry)(T),function r(n){return function(e){return T(L,r(n),A(n,e))}}),A=function(r,n){return U(r,T(M,Z(r),n))};e.everywhere=(0,w.curry)(A)},{infestines:void 0}]},{},[1])(1)}); |
@@ -144,8 +144,7 @@ "use strict"; | ||
function downPathU(path, z) { | ||
var downPath = exports.downPath = (0, _infestines.curry)(function (path, z) { | ||
for (var i = 0, n = path.length; z && i < n; ++i) { | ||
z = downToU(path[i], z); | ||
}return z; | ||
} | ||
var downPath = exports.downPath = (0, _infestines.curry)(downPathU); | ||
}); | ||
@@ -234,7 +233,7 @@ var downMost = function downMost(head) { | ||
while (z && (0, _infestines.isDefined)(z.key)) { | ||
path.unshift(z.key); | ||
path.push(z.key); | ||
z = z.up; | ||
} | ||
return path; | ||
return path.reverse(); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mYXN0ZW5lci5qcyJdLCJuYW1lcyI6WyJ1cCIsImhlYWQiLCJsYXN0IiwiZnJvbVppcHBlciIsInBhdGhPZiIsImZpcnN0S2V5IiwibyIsImsiLCJsYXN0S2V5Iiwia2V5IiwiaXNTdHJpbmciLCJ4IiwiaXNOdW1iZXIiLCJyZXZlcnNlIiwiZnJvbSIsInRvIiwibGVuZ3RoIiwiemlwcGVyIiwibGVmdCIsImZvY3VzIiwicmlnaHQiLCJpbnRvT2JqZWN0IiwibGlzdCIsIm9iamVjdCIsImZyb21PYmplY3QiLCJpbnRvQXJyYXkiLCJhcnJheSIsInB1c2giLCJmcm9tQXJyYXkiLCJpIiwiZ2V0IiwieiIsImtleU9mIiwic2V0VSIsInNldCIsIm1vZGlmeVUiLCJmIiwibW9kaWZ5IiwiZG93blRvVSIsImRvd25UbyIsImRvd25QYXRoVSIsInBhdGgiLCJuIiwiZG93blBhdGgiLCJkb3duTW9zdCIsImRvd25IZWFkIiwiZG93bkxhc3QiLCJ1IiwidG9aaXBwZXIiLCJxdWVyeU1vdmVVIiwibW92ZSIsImIiLCJtIiwicXVlcnlNb3ZlIiwiYndkIiwidHJhbnNmb3JtTW92ZVUiLCJ0cmFuc2Zvcm1Nb3ZlIiwiZXZlcnl3aGVyZUciLCJld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B6ID0+XG4gIHRyYW5zZm9ybU1vdmVVKHJpZ2h0LCBldmVyeXdoZXJlRyhmKSwgZXZlcnl3aGVyZVUoZiwgeikpXG5jb25zdCBldmVyeXdoZXJlVSA9IChmLCB6KSA9PlxuICBtb2RpZnlVKGYsIHRyYW5zZm9ybU1vdmVVKGRvd25IZWFkLCBldmVyeXdoZXJlRyhmKSwgeikpXG5leHBvcnQgY29uc3QgZXZlcnl3aGVyZSA9IGN1cnJ5KGV2ZXJ5d2hlcmVVKVxuXG5leHBvcnQgZnVuY3Rpb24gcGF0aE9mKHopIHtcbiAgY29uc3QgcGF0aCA9IFtdXG4gIHdoaWxlICh6ICYmIGlzRGVmaW5lZCh6LmtleSkpIHtcbiAgICBwYXRoLnB1c2goei5rZXkpXG4gICAgeiA9IHoudXBcbiAgfVxuICByZXR1cm4gcGF0aC5yZXZlcnNlKClcbn1cbiJdfQ== |
{ | ||
"name": "fastener", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Zipper for manipulating JSON", | ||
@@ -9,4 +9,4 @@ "main": "lib/fastener.js", | ||
"dist": "npm run dist:bowerify & npm run dist:bowerify.min & npm run dist:commonjs & wait", | ||
"dist:bowerify": " NODE_ENV=dev browserify src/fastener.js -t babelify --no-bundle-external -d -s F -g envify -o dist/fastener.js", | ||
"dist:bowerify.min": "NODE_ENV=production browserify src/fastener.js -t babelify --no-bundle-external -s F -g envify -g uglifyify -o dist/fastener.min.js", | ||
"dist:bowerify": " NODE_ENV=dev browserify src/fastener.js -t babelify --no-bundle-external -d -s F -g envify > dist/fastener.js", | ||
"dist:bowerify.min": "NODE_ENV=production browserify src/fastener.js -t babelify --no-bundle-external -s F -g envify -g uglifyify | uglifyjs -m -c > dist/fastener.min.js", | ||
"dist:commonjs": "babel src --source-maps inline --out-dir lib", | ||
@@ -76,4 +76,5 @@ "docs": "./scripts/generate-docs", | ||
"sprintf-js": "^1.0.3", | ||
"uglify-js": "^2.7.5", | ||
"uglifyify": "^3.0.4" | ||
} | ||
} |
@@ -9,3 +9,3 @@ [ [≡](#contents) | [Tutorial](#tutorial) | [Reference](#reference) | [Related Work](#related-work) | [GitHub](https://github.com/polytypic/fastener) | [Try Fastener!](https://polytypic.github.io/fastener/) ] | ||
[![npm version](https://badge.fury.io/js/fastener.svg)](http://badge.fury.io/js/fastener) [![Build Status](https://travis-ci.org/polytypic/fastener.svg?branch=master)](https://travis-ci.org/polytypic/fastener) [![Code Coverage](https://img.shields.io/codecov/c/github/polytypic/fastener/master.svg)](https://codecov.io/github/polytypic/fastener?branch=master) [![](https://david-dm.org/polytypic/fastener.svg)](https://david-dm.org/polytypic/fastener) [![](https://david-dm.org/polytypic/fastener/dev-status.svg)](https://david-dm.org/polytypic/fastener?type=dev) | ||
[![npm version](https://badge.fury.io/js/fastener.svg)](http://badge.fury.io/js/fastener) [![Bower version](https://badge.fury.io/bo/fastener.svg)](https://badge.fury.io/bo/fastener) [![Build Status](https://travis-ci.org/polytypic/fastener.svg?branch=master)](https://travis-ci.org/polytypic/fastener) [![Code Coverage](https://img.shields.io/codecov/c/github/polytypic/fastener/master.svg)](https://codecov.io/github/polytypic/fastener?branch=master) [![](https://david-dm.org/polytypic/fastener.svg)](https://david-dm.org/polytypic/fastener) [![](https://david-dm.org/polytypic/fastener/dev-status.svg)](https://david-dm.org/polytypic/fastener?type=dev) | ||
@@ -12,0 +12,0 @@ ## Contents |
@@ -129,8 +129,7 @@ import { | ||
function downPathU(path, z) { | ||
export const downPath = curry((path, z) => { | ||
for (let i=0, n=path.length; z && i<n; ++i) | ||
z = downToU(path[i], z) | ||
return z | ||
} | ||
export const downPath = curry(downPathU) | ||
}) | ||
@@ -194,6 +193,6 @@ const downMost = head => z => { | ||
while (z && isDefined(z.key)) { | ||
path.unshift(z.key) | ||
path.push(z.key) | ||
z = z.up | ||
} | ||
return path | ||
return path.reverse() | ||
} |
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
0
115445
36
646