New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

extraction

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extraction - npm Package Compare versions

Comparing version 0.9.13 to 0.9.14

2

bower.json
{
"name": "extraction",
"version": "0.9.13",
"version": "0.9.14",
"description": "Tree Extraction for JavaScript Object Graphs",

@@ -5,0 +5,0 @@ "main": "lib/extraction.js",

@@ -27,3 +27,3 @@ /*

(function (global){
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.ASTY=e()}}(function(){return function e(n,t,r){function o(u,a){if(!t[u]){if(!n[u]){var f="function"==typeof _dereq_&&_dereq_;if(!a&&f)return f(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var c=t[u]={exports:{}};n[u][0].call(c.exports,function(e){var t=n[u][1][e];return o(t||e)},c,c.exports,e,n,t,r)}return t[u].exports}for(var i="function"==typeof _dereq_&&_dereq_,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,[{key:"init",value:function(e,n,t,r){if(arguments.length<2)throw new Error("init: invalid number of arguments");if(this.ctx=e,this.ASTy=!0,this.T=n,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,"object"===(void 0===t?"undefined":o(t)))for(var i in t)t.hasOwnProperty(i)&&this.set(i,t[i]);return"object"===(void 0===r?"undefined":o(r))&&r instanceof Array&&this.add(r),this}},{key:"type",value:function(e){if(0===arguments.length)return this.T;if(1===arguments.length)return this.T=e,this;throw new Error("type: invalid number of arguments")}},{key:"pos",value:function(e,n,t){if(0===arguments.length)return{line:this.L.L,column:this.L.C,offset:this.L.O};if(arguments.length<=3)return this.L.L=e||0,this.L.C=n||0,this.L.O=t||0,this;throw new Error("pos: invalid number of arguments")}},{key:"set",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(1===t.length&&"object"===o(t[0]))Object.keys(t[0]).forEach(function(n){e.A[n]=t[0][n]});else{if(2!==t.length)throw new Error("set: invalid number of arguments");this.A[t[0]]=t[1]}return this}},{key:"unset",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(1===t.length&&"object"===o(t[0])&&t[0]instanceof Array)t[0].forEach(function(n){delete e.A[n]});else{if(1!==t.length)throw new Error("unset: invalid number of arguments");delete this.A[t[0]]}return this}},{key:"get",value:function(e){if(1!==arguments.length)throw new Error("get: invalid number of arguments");if("string"!=typeof e)throw new Error("get: invalid key argument");return this.A[e]}},{key:"attrs",value:function(){return Object.keys(this.A)}},{key:"nth",value:function(){if(null===this.P)return 1;var e=this.P.C.indexOf(this);if(e<0)throw new Error("nth: internal error -- node not in childs of its parent");return e}},{key:"ins",value:function(e){for(var n=this,t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(0===r.length)throw new Error("ins: invalid number of arguments");if(e<0&&(e=this.C.length+1-e),!(0<=e&&e<=this.C.length))throw new Error("ins: invalid position");var u=function(t){if(!n.ctx.isA(t))throw new Error("ins: invalid AST node argument");n.C.splice(e++,0,t),t.P=n};return r.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&e instanceof Array?e.forEach(function(e){u(e)}):null!==e&&u(e)}),this}},{key:"add",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw new Error("add: invalid number of arguments");var i=function(n){if(!e.ctx.isA(n))throw new Error("add: invalid AST node argument");e.C.push(n),n.P=e};return t.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&e instanceof Array?e.forEach(function(e){i(e)}):null!==e&&i(e)}),this}},{key:"del",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw new Error("del: invalid number of argument");return t.forEach(function(n){if(!e.ctx.isA(n))throw new Error("del: invalid AST node argument");for(var t=!1,r=0;r<e.C.length;r++)if(e.C[r]===n){e.C.splice(r,1),n.P=null,t=!0;break}if(!t)throw new Error("del: AST node not found in childs")}),this}},{key:"childs",value:function(){return this.C}},{key:"parent",value:function(){return this.P}},{key:"serialize",value:function(){return this.ctx.serialize(this.ctx,this)}}]),e}();t.default=u},{}],2:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,[{key:"dump",value:function(e){void 0===e&&(e=1/0);var n="";return this.walk(function(t,r){if(!(r>e)){for(var i=0;i<r;i++)n+=" ";n+=t.T+" ";var u=Object.keys(t.A);u.length>0&&function(){n+="(";var e=!0;u.forEach(function(r){e?e=!1:n+=", ",n+=r+": ";var i=t.A[r];!function(){switch(void 0===i?"undefined":o(i)){case"boolean":case"number":n+=i.toString();break;case"string":var e=function(e){return e.charCodeAt(0).toString(16).toUpperCase()};n+='"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(n){return"\\x0"+e(n)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(n){return"\\x"+e(n)}).replace(/[\u0100-\u0FFF]/g,function(n){return"\\u0"+e(n)}).replace(/[\u1000-\uFFFF]/g,function(n){return"\\u"+e(n)})+'"';break;case"object":i instanceof RegExp?n+=i.source:n+=JSON.stringify(i);break;default:n+=JSON.stringify(i)}}()}),n+=") "}(),n+="["+t.L.L+"/"+t.L.C+"]\n"}},"downward"),n}}]),e}();t.default=u},{}],3:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),i=function(){function e(){r(this,e)}return o(e,[{key:"merge",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.ctx.isA(e))throw new Error("merge: invalid AST node argument");if(t){var o=e.pos();this.pos(o.L,o.C,o.O)}return e.attrs().forEach(function(t){var o=void 0!==r[t]?r[t]:t;null!==o&&n.set(o,e.get(t))}),e.childs().forEach(function(e){n.add(e)}),this}}]),e}();t.default=i},{}],4:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,null,[{key:"serialize",value:function(e,n){if(!e.isA(n))throw new Error("serialize: not an ASTy node");return JSON.stringify({ASTy:function e(n){var t={T:n.T,L:{L:n.L.L,C:n.L.C,O:n.L.O}},r=Object.keys(n.A);return r.length>0&&(t.A={},r.forEach(function(e){var r=n.A[e];switch(void 0===r?"undefined":o(r)){case"boolean":case"number":case"string":t.A[e]=r;break;default:t.A[e]=JSON.parse(JSON.stringify(r))}})),n.C.length>0&&(t.C=n.C.map(function(n){return e(n)})),t}(n)})}},{key:"unserialize",value:function(e,n){var t=JSON.parse(n);if("object"!==(void 0===t?"undefined":o(t))||"object"!==o(t.ASTy))throw new Error("unserialize: not an ASTy JSON export");return function n(t){var r=e.create(t.T);return r.pos(t.L.L,t.L.C,t.L.O),"object"===o(t.A)&&Object.keys(t.A).forEach(function(e){var n=t.A[e];switch(void 0===n?"undefined":o(n)){case"boolean":case"number":case"string":r.set(e,n);break;default:r.set(e,JSON.parse(JSON.stringify(n)))}}),"object"===o(t.C)&&t.C instanceof Array&&r.add(t.C.map(function(e){return n(e)})),r}(t.ASTy)}}]),e}();t.default=u},{}],5:[function(e,n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={major:1,minor:4,micro:8,date:20161120};t.default=r},{}],6:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),i=function(){function e(){r(this,e)}return o(e,[{key:"walk",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"downward";return function t(r,o,i){"downward"!==n&&"both"!==n||e.call(null,r,o,i,"downward"),r.C.forEach(function(e){t(e,o+1,r)}),"upward"!==n&&"both"!==n||e.call(null,r,o,i,"upward")}(this,0,null),this}}]),e}();t.default=i},{}],7:[function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),a=e("./asty-base.js"),f=r(a),s=e("./asty-merge.js"),c=r(s),l=e("./asty-walk.js"),y=r(l),h=e("./asty-dump.js"),d=r(h),p=e("./asty-serialize.js"),v=r(p),b=e("./asty-version.js"),g=r(b),m=function(){function e(){var n=this;return o(this,e),this.ASTYNode=function(){},[[f.default,"init","type","pos","set","unset","get","attrs","nth","ins","add","del","childs","parent","serialize"],[c.default,"merge"],[y.default,"walk"],[d.default,"dump"]].forEach(function(e){var t=e[0].prototype;e.slice(1).forEach(function(e){n.ASTYNode.prototype[e]=t[e]})}),this}return u(e,[{key:"version",value:function(){return g.default}},{key:"extend",value:function(e){for(var n in e)e.hasOwnProperty(n)&&(this.ASTYNode.prototype[n]=e[n]);return this}},{key:"create",value:function(e){return(new this.ASTYNode).init(this,e)}},{key:"isA",value:function(e){return"object"===(void 0===e?"undefined":i(e))&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&!0===e.ASTy}},{key:"serialize",value:function(e){return v.default.serialize(this,e)}},{key:"unserialize",value:function(e){return v.default.unserialize(this,e)}}]),e}();n.exports=m},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-serialize.js":4,"./asty-version.js":5,"./asty-walk.js":6}]},{},[1,2,3,4,5,6,7])(7)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.ASTY=e()}}(function(){return function e(n,t,r){function o(u,a){if(!t[u]){if(!n[u]){var f="function"==typeof _dereq_&&_dereq_;if(!a&&f)return f(u,!0);if(i)return i(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var s=t[u]={exports:{}};n[u][0].call(s.exports,function(e){var t=n[u][1][e];return o(t||e)},s,s.exports,e,n,t,r)}return t[u].exports}for(var i="function"==typeof _dereq_&&_dereq_,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,[{key:"init",value:function(e,n,t,r){if(arguments.length<2)throw new Error("init: invalid number of arguments");if(this.ctx=e,this.ASTy=!0,this.T=n,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,"object"===(void 0===t?"undefined":o(t)))for(var i in t)t.hasOwnProperty(i)&&this.set(i,t[i]);return"object"===(void 0===r?"undefined":o(r))&&r instanceof Array&&this.add(r),this}},{key:"type",value:function(e){if(0===arguments.length)return this.T;if(1===arguments.length)return this.T=e,this;throw new Error("type: invalid number of arguments")}},{key:"pos",value:function(e,n,t){if(0===arguments.length)return{line:this.L.L,column:this.L.C,offset:this.L.O};if(arguments.length<=3)return this.L.L=e||0,this.L.C=n||0,this.L.O=t||0,this;throw new Error("pos: invalid number of arguments")}},{key:"set",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(1===t.length&&"object"===o(t[0]))Object.keys(t[0]).forEach(function(n){e.A[n]=t[0][n]});else{if(2!==t.length)throw new Error("set: invalid number of arguments");this.A[t[0]]=t[1]}return this}},{key:"unset",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(1===t.length&&"object"===o(t[0])&&t[0]instanceof Array)t[0].forEach(function(n){delete e.A[n]});else{if(1!==t.length)throw new Error("unset: invalid number of arguments");delete this.A[t[0]]}return this}},{key:"get",value:function(e){if(1!==arguments.length)throw new Error("get: invalid number of arguments");if("string"!=typeof e)throw new Error("get: invalid key argument");return this.A[e]}},{key:"attrs",value:function(){return Object.keys(this.A)}},{key:"nth",value:function(){if(null===this.P)return 1;var e=this.P.C.indexOf(this);if(e<0)throw new Error("nth: internal error -- node not in childs of its parent");return e}},{key:"ins",value:function(e){for(var n=this,t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(0===r.length)throw new Error("ins: invalid number of arguments");if(e<0&&(e=this.C.length+1-e),!(0<=e&&e<=this.C.length))throw new Error("ins: invalid position");var u=function(t){if(!n.ctx.isA(t))throw new Error("ins: invalid AST node argument");n.C.splice(e++,0,t),t.P=n};return r.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&e instanceof Array?e.forEach(function(e){u(e)}):null!==e&&u(e)}),this}},{key:"add",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw new Error("add: invalid number of arguments");var i=function(n){if(!e.ctx.isA(n))throw new Error("add: invalid AST node argument");e.C.push(n),n.P=e};return t.forEach(function(e){"object"===(void 0===e?"undefined":o(e))&&e instanceof Array?e.forEach(function(e){i(e)}):null!==e&&i(e)}),this}},{key:"del",value:function(){for(var e=this,n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw new Error("del: invalid number of argument");return t.forEach(function(n){if(!e.ctx.isA(n))throw new Error("del: invalid AST node argument");for(var t=!1,r=0;r<e.C.length;r++)if(e.C[r]===n){e.C.splice(r,1),n.P=null,t=!0;break}if(!t)throw new Error("del: AST node not found in childs")}),this}},{key:"childs",value:function(){return this.C}},{key:"parent",value:function(){return this.P}},{key:"serialize",value:function(){return this.ctx.serialize(this.ctx,this)}}]),e}();t.default=u},{}],2:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,[{key:"dump",value:function(e){void 0===e&&(e=1/0);var n="";return this.walk(function(t,r){if(!(r>e)){for(var i=0;i<r;i++)n+=" ";n+=t.T+" ";var u=Object.keys(t.A);if(u.length>0){n+="(";var a=!0;u.forEach(function(e){a?a=!1:n+=", ",n+=e+": ";var r=t.A[e];switch(void 0===r?"undefined":o(r)){case"boolean":case"number":n+=r.toString();break;case"string":var i=function(e){return e.charCodeAt(0).toString(16).toUpperCase()};n+='"'+r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+i(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+i(e)}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+i(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+i(e)})+'"';break;case"object":r instanceof RegExp?n+=r.source:n+=JSON.stringify(r);break;default:n+=JSON.stringify(r)}}),n+=") "}n+="["+t.L.L+"/"+t.L.C+"]\n"}},"downward"),n}}]),e}();t.default=u},{}],3:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),i=function(){function e(){r(this,e)}return o(e,[{key:"merge",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return this;if(!this.ctx.isA(e))throw new Error("merge: invalid AST node argument");if(t){var o=e.pos();this.pos(o.L,o.C,o.O)}return e.attrs().forEach(function(t){var o=void 0!==r[t]?r[t]:t;null!==o&&n.set(o,e.get(t))}),e.childs().forEach(function(e){n.add(e)}),this}}]),e}();t.default=i},{}],4:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),u=function(){function e(){r(this,e)}return i(e,null,[{key:"serialize",value:function(e,n){if(!e.isA(n))throw new Error("serialize: not an ASTy node");return JSON.stringify({ASTy:function e(n){var t={T:n.T,L:{L:n.L.L,C:n.L.C,O:n.L.O}},r=Object.keys(n.A);return r.length>0&&(t.A={},r.forEach(function(e){var r=n.A[e];switch(void 0===r?"undefined":o(r)){case"boolean":case"number":case"string":t.A[e]=r;break;default:t.A[e]=JSON.parse(JSON.stringify(r))}})),n.C.length>0&&(t.C=n.C.map(function(n){return e(n)})),t}(n)})}},{key:"unserialize",value:function(e,n){var t=JSON.parse(n);if("object"!==(void 0===t?"undefined":o(t))||"object"!==o(t.ASTy))throw new Error("unserialize: not an ASTy JSON export");return function n(t){var r=e.create(t.T);return r.pos(t.L.L,t.L.C,t.L.O),"object"===o(t.A)&&Object.keys(t.A).forEach(function(e){var n=t.A[e];switch(void 0===n?"undefined":o(n)){case"boolean":case"number":case"string":r.set(e,n);break;default:r.set(e,JSON.parse(JSON.stringify(n)))}}),"object"===o(t.C)&&t.C instanceof Array&&r.add(t.C.map(function(e){return n(e)})),r}(t.ASTy)}}]),e}();t.default=u},{}],5:[function(e,n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={major:1,minor:5,micro:0,date:20170417};t.default=r},{}],6:[function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),i=function(){function e(){r(this,e)}return o(e,[{key:"walk",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"downward";return function t(r,o,i){"downward"!==n&&"both"!==n||e.call(null,r,o,i,"downward"),r.C.forEach(function(e){t(e,o+1,r)}),"upward"!==n&&"both"!==n||e.call(null,r,o,i,"upward")}(this,0,null),this}}]),e}();t.default=i},{}],7:[function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),a=e("./asty-base.js"),f=r(a),l=e("./asty-merge.js"),s=r(l),c=e("./asty-walk.js"),y=r(c),h=e("./asty-dump.js"),d=r(h),p=e("./asty-serialize.js"),v=r(p),b=e("./asty-version.js"),g=r(b),m=function(){function e(){var n=this;return o(this,e),this.ASTYNode=function(){},[[f.default,"init","type","pos","set","unset","get","attrs","nth","ins","add","del","childs","parent","serialize"],[s.default,"merge"],[y.default,"walk"],[d.default,"dump"]].forEach(function(e){var t=e[0].prototype;e.slice(1).forEach(function(e){n.ASTYNode.prototype[e]=t[e]})}),this}return u(e,[{key:"version",value:function(){return g.default}},{key:"extend",value:function(e){for(var n in e)e.hasOwnProperty(n)&&(this.ASTYNode.prototype[n]=e[n]);return this}},{key:"create",value:function(e){return(new this.ASTYNode).init(this,e)}},{key:"isA",value:function(e){return"object"===(void 0===e?"undefined":i(e))&&e instanceof this.ASTYNode&&"boolean"==typeof e.ASTy&&!0===e.ASTy}},{key:"serialize",value:function(e){return v.default.serialize(this,e)}},{key:"unserialize",value:function(e){return v.default.unserialize(this,e)}}]),e}();n.exports=m},{"./asty-base.js":1,"./asty-dump.js":2,"./asty-merge.js":3,"./asty-serialize.js":4,"./asty-version.js":5,"./asty-walk.js":6}]},{},[1,2,3,4,5,6,7])(7)});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

@@ -30,0 +30,0 @@

{
"name": "extraction",
"version": "0.9.13",
"version": "0.9.14",
"description": "Tree Extraction for JavaScript Object Graphs",

@@ -25,3 +25,3 @@ "keywords": [ "tree", "graph", "data", "structure", "extraction", "object" ],

"pegjs-util": "~1.4.2",
"asty": "~1.4.8",
"asty": "~1.5.0",
"cache-lru": "~1.0.15"

@@ -33,6 +33,6 @@ },

"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-clean": "~1.0.0",
"grunt-contrib-clean": "~1.1.0",
"grunt-browserify": "~5.0.0",
"grunt-mocha-test": "~0.13.2",
"mocha": "~3.2.0",
"mocha": "~3.3.0",
"chai": "~3.5.0",

@@ -44,4 +44,4 @@ "babelify": "~7.3.0",

"browserify-derequire": "~0.9.4",
"source-map-support": "~0.4.14"
"source-map-support": "~0.4.15"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc