Comparing version 1.7.5 to 1.7.6
@@ -25,3 +25,3 @@ /* | ||
(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.ASTY = 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(_dereq_,module,exports){ | ||
(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.ASTY = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="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},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ASTYBase=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"init",value:function(e,t,n,r){if(arguments.length<2)throw new Error("init: invalid number of arguments");if(this.ctx=e,this.ASTy=!0,this.T=t,this.L={L:0,C:0,O:0},this.A={},this.C=[],this.P=null,"object"===(void 0===n?"undefined":_typeof(n)))for(var i in n)n.hasOwnProperty(i)&&this.set(i,n[i]);return"object"===(void 0===r?"undefined":_typeof(r))&&r instanceof Array&&this.add(r),this}},{key:"create",value:function(e,t,n){return this.ctx.create(e,t,n)}},{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,t,n){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=t||0,this.L.O=n||0,this;throw new Error("pos: invalid number of arguments")}},{key:"set",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(1===n.length&&"object"===_typeof(n[0]))Object.keys(n[0]).forEach(function(t){void 0!==n[0][t]?e.A[t]=n[0][t]:delete e.A[t]});else{if(2!==n.length)throw new Error("set: invalid number of arguments");void 0!==n[1]?this.A[n[0]]=n[1]:delete this.A[n[0]]}return this}},{key:"unset",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(1===n.length&&"object"===_typeof(n[0])&&n[0]instanceof Array)n[0].forEach(function(t){delete e.A[t]});else{if(1!==n.length)throw new Error("unset: invalid number of arguments");delete this.A[n[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 t=this,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;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),!(e>=0&&e<=this.C.length))throw new Error("ins: invalid position");var o=function(n){if(!t.ctx.isA(n))throw new Error("ins: invalid AST node argument");t.C.splice(e++,0,n),n.P=t};return r.forEach(function(e){"object"===(void 0===e?"undefined":_typeof(e))&&e instanceof Array?e.forEach(function(e){o(e)}):null!==e&&o(e)}),this}},{key:"add",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0===n.length)throw new Error("add: invalid number of arguments");var i=function(t){if(!e.ctx.isA(t))throw new Error("add: invalid AST node argument");e.C.push(t),t.P=e};return n.forEach(function(e){"object"===(void 0===e?"undefined":_typeof(e))&&e instanceof Array?e.forEach(function(e){i(e)}):null!==e&&i(e)}),this}},{key:"del",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if(0===n.length)throw new Error("del: invalid number of arguments");return n.forEach(function(t){if(!e.ctx.isA(t))throw new Error("del: invalid AST node argument");for(var n=!1,r=0;r<e.C.length;r++)if(e.C[r]===t){e.C.splice(r,1),t.P=null,n=!0;break}if(!n)throw new Error("del: AST node not found in childs")}),this}},{key:"childs",value:function(){if(arguments.length>2)throw new Error("childs: invalid number of arguments");if(2===arguments.length&&"number"==typeof(arguments.length<=0?void 0:arguments[0])&&"number"==typeof(arguments.length<=1?void 0:arguments[1]))return this.C.slice(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1]);if(1===arguments.length&&"number"==typeof(arguments.length<=0?void 0:arguments[0]))return this.C.slice(arguments.length<=0?void 0:arguments[0]);if(0===arguments.length)return this.C;throw new Error("childs: invalid type of arguments")}},{key:"child",value:function(e){if("number"!=typeof e)throw new Error("child: invalid argument");return e<this.C.length?this.C[e]:null}},{key:"parent",value:function(){return this.P}},{key:"serialize",value:function(){return this.ctx.serialize(this)}}]),e}();exports.default=ASTYBase; | ||
@@ -41,2 +41,2 @@ },{}],2:[function(_dereq_,module,exports){ | ||
},{"./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) | ||
}); | ||
}); |
@@ -25,3 +25,3 @@ /* | ||
(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.ASTY = 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(_dereq_,module,exports){ | ||
(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.ASTY = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){ | ||
"use strict"; | ||
@@ -883,2 +883,2 @@ | ||
},{"./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) | ||
}); | ||
}); |
{ | ||
"name": "asty", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"description": "Abstract Syntax Tree (AST) Data Structure", | ||
@@ -24,6 +24,6 @@ "keywords": [ "ast", "abstract", "syntax", "tree", "data", "structure" ], | ||
"grunt-contrib-clean": "1.1.0", | ||
"grunt-browserify": "5.2.0", | ||
"grunt-browserify": "5.3.0", | ||
"grunt-mocha-test": "0.13.3", | ||
"grunt-eslint": "20.1.0", | ||
"babel-eslint": "8.2.2", | ||
"babel-eslint": "8.2.3", | ||
"babel-core": "6.26.0", | ||
@@ -34,5 +34,5 @@ "eslint": "4.19.1", | ||
"eslint-plugin-promise": "3.7.0", | ||
"eslint-plugin-import": "2.10.0", | ||
"eslint-plugin-import": "2.11.0", | ||
"eslint-plugin-node": "6.0.1", | ||
"mocha": "5.0.5", | ||
"mocha": "5.1.1", | ||
"chai": "4.1.2", | ||
@@ -39,0 +39,0 @@ "babelify": "8.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117599
1704