יחידה:ParamValidator: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
בגים בבדיקת סוג
moya ocd
שורה 102:
function calculateViolations( frame, subpages )
 
-- used for parameter type validy test. addkeyed "isDate",by "isWikicode"TD etc'type' string. values are function(val) returning bool.
local type_validators = {
['number'] = function( s ) return mw.language.getContentLanguage():parseFormattedNumber( s ) end
}
function compatible( typ, val )
iflocal type(func = type_validators[typ] ) == 'function' and not util.empty( val ) then
return type_validators[typ]type( func ) ~= 'function' or util.empty( val ) or func( val )
end
return true
end