Skip to content
This repository
Browse code

Add a compatibility layer

  • Loading branch information...
commit 58da343d6a803a9c8b6435a696d91455905cc6bf 1 parent dd51353
František Hába authored

Showing 1 changed file with 40 additions and 0 deletions. Show diff stats Hide diff stats

  1. +40 0 src/amanda.js
40 src/amanda.js
@@ -6,4 +6,44 @@ var Amanda = function(engine) {
6 6
7 7 return engines[engine];
8 8
  9 +};
  10 +
  11 +/**
  12 + * Amanda.validate
  13 + *
  14 + * This method is deprecated, please use ‘amanda('json').validate’ instead.
  15 + */
  16 +Amanda.validate = function(instance, schema, options, callback) {
  17 + var json = engines.json;
  18 + return json.validate.apply(json, arguments);
  19 +};
  20 +
  21 +/**
  22 + * Amanda.addValidator
  23 + *
  24 + * This method is deprecated, please use ‘amanda('json').addValidator’ instead.
  25 + */
  26 +Amanda.addValidator = function(attributeName, attributeFn) {
  27 + var json = engines.json;
  28 + return json.addAttribute.apply(json, arguments);
  29 +};
  30 +
  31 +/**
  32 + * Amanda.addAttribute
  33 + *
  34 + * This method is deprecated, please use ‘amanda('json').addAttribute’ instead.
  35 + */
  36 +Amanda.addAttribute = function(attributeName, attributeFn) {
  37 + var json = engines.json;
  38 + return json.addAttribute.apply(json, arguments);
  39 +};
  40 +
  41 +/**
  42 + * Amanda.addAttributeConstructor
  43 + *
  44 + * This method is deprecated, please use ‘amanda('json').addAttributeConstructor’ instead.
  45 + */
  46 +Amanda.addAttributeConstructor = function(attributeName, attributeConstructor) {
  47 + var json = engines.json;
  48 + return json.addAttributeConstructor.apply(json, arguments);
9 49 };

0 comments on commit 58da343

Please sign in to comment.
Something went wrong with that request. Please try again.