/usr/share/javascript/yui3/dataschema-base/dataschema-base.js is in libjs-yui3-full 3.5.1-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('dataschema-base', function(Y) {
/**
* The DataSchema utility provides a common configurable interface for widgets to
* apply a given schema to a variety of data.
*
* @module dataschema
* @main dataschema
*/
/**
* Provides the base DataSchema implementation, which can be extended to
* create DataSchemas for specific data formats, such XML, JSON, text and
* arrays.
*
* @module dataschema
* @submodule dataschema-base
*/
var LANG = Y.Lang,
/**
* Base class for the YUI DataSchema Utility.
* @class DataSchema.Base
* @static
*/
SchemaBase = {
/**
* Overridable method returns data as-is.
*
* @method apply
* @param schema {Object} Schema to apply.
* @param data {Object} Data.
* @return {Object} Schema-parsed data.
* @static
*/
apply: function(schema, data) {
return data;
},
/**
* Applies field parser, if defined
*
* @method parse
* @param value {Object} Original value.
* @param field {Object} Field.
* @return {Object} Type-converted value.
*/
parse: function(value, field) {
if(field.parser) {
var parser = (LANG.isFunction(field.parser)) ?
field.parser : Y.Parsers[field.parser+''];
if(parser) {
value = parser.call(this, value);
}
else {
}
}
return value;
}
};
Y.namespace("DataSchema").Base = SchemaBase;
Y.namespace("Parsers");
}, '3.5.1' ,{requires:['base']});
|