Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "ducky", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Duck-Typed Value Handling for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ducky.browser.js", |
@@ -26,3 +26,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.Ducky = 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){ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var version={major:2,minor:2,micro:0,date:20150707};exports.version=version; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var version={major:2,minor:2,micro:1,date:20150707};exports.version=version; | ||
},{}],2:[function(_dereq_,module,exports){ | ||
@@ -29,0 +29,0 @@ "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,s,n){return s&&e(t.prototype,s),n&&e(t,n),t}}(),Token=function(){function e(){_classCallCheck(this,e),this.name="",this.text="",this.tokens=[],this.pos=0,this.len=0}return _createClass(e,[{key:"setName",value:function(e){this.name=e}},{key:"setText",value:function(e){this.text=e}},{key:"addToken",value:function(e,t,s,n,o){this.tokens.push({b1:e,b2:t,e2:s,e1:n,symbol:o}),this.len++}},{key:"peek",value:function(e){if("undefined"==typeof e&&(e=0),e>=this.len)throw new Error(this.name+": parse error: not enough tokens");return this.tokens[this.pos+e].symbol}},{key:"skip",value:function(e){if("undefined"==typeof e&&(e=1),e>this.len)throw new Error(this.name+": parse error: not enough tokens available to skip: "+this.ctx());this.pos+=e,this.len-=e}},{key:"consume",value:function(e){if(this.len<=0)throw new Error(this.name+": parse error: no more tokens available to consume: "+this.ctx());if(this.tokens[this.pos].symbol!==e)throw new Error(this.name+': parse error: expected token symbol "'+e+'": '+this.ctx());this.pos++,this.len--}},{key:"ctx",value:function t(e){"undefined"==typeof e&&(e=78);var s=this.tokens[this.pos],t="<"+this.text.substr(s.b2,s.e2-s.b2+1)+">";t=this.text.substr(s.b1,s.b2-s.b1)+t,t+=this.text.substr(s.e2+1,s.e1-s.e2);var n=e-t.length;if(n>0){n=Math.floor(n/2);var o=void 0,i=void 0;if(this.pos>0){var r=0;for(o=this.pos-1;o>=0&&(s=this.tokens[o],i=this.text.substr(s.b1,s.e1-s.b1+1),r+=i.length,!(r>n));o--)t=i+t;o>0&&(t="[...]"+t)}if(this.len>1){var h=0;for(o=this.pos+1;o<this.pos+this.len&&(s=this.tokens[o],i=this.text.substr(s.b1,s.e1-s.b1+1),h+=i.length,!(h>n));o++)t+=i;o<this.pos+this.len&&(t+="[...]")}}return t=t.replace(/\r/,"\\r").replace(/\n/,"\\n").replace(/\t/,"\\t")}}]),e}();exports.Token=Token; |
@@ -52,3 +52,3 @@ /*! | ||
/* global 2: false */ | ||
/* global 0: false */ | ||
/* global 1: false */ | ||
/* global 20150707: false */ | ||
@@ -65,3 +65,3 @@ | ||
minor: 2, | ||
micro: 0, | ||
micro: 1, | ||
date: 20150707 | ||
@@ -68,0 +68,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "Duck-Typed Value Handling for JavaScript", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -114,3 +114,3 @@ | ||
#### ducky.validate(object: Object, spec: String): Boolean | ||
#### ducky.validate(object: Object, spec: String, errors?: String[]): Boolean | ||
@@ -141,2 +141,5 @@ Validate an arbitrary nested JavaScript object `object` against the | ||
If an empty `errors` array is given, use it to assemble detailed error | ||
messages in case of a validation failure. | ||
In case caching of the internally compiled Abstract Syntax Tree (AST) | ||
@@ -150,5 +153,7 @@ is not wishes, you can perform the compile and execute steps | ||
##### ducky.validate.execute(object: Object, ast: Object): Boolean | ||
##### ducky.validate.execute(object: Object, ast: Object, errors?: String[]): Boolean | ||
Validate `object` against `ast` and return `true` in case it validates. | ||
If an empty `errors` array is given, use it to assemble detailed error | ||
messages in case of a validation failure. | ||
@@ -155,0 +160,0 @@ #### ducky.params(name: String, args: Object[], spec: Object): Object |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
261611
211
0