Modul:File link: Perbedaan antara revisi

9 bita dihapus ,  1 tahun yang lalu
←Membuat halaman berisi '-- This module provides a library for formatting file wikilinks. local yesno = require('Modul:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "galat p...'
dw>MusikAnimal
(Undid revision 948472508 by [[Special:Contributions/w>IPad365|w>IPad365]] ([[User talk:w>IPad365|talk]]))
(←Membuat halaman berisi '-- This module provides a library for formatting file wikilinks. local yesno = require('Modul:Yesno') local checkType = require('libraryUtil').checkType local p = {} function p._main(args) checkType('_main', 1, args, 'table') -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "galat p...')
Baris 1: Baris 1:
-- This module provides a library for formatting file wikilinks.
-- This module provides a library for formatting file wikilinks.


local yesno = require('Module:Yesno')
local yesno = require('Modul:Yesno')
local checkType = require('libraryUtil').checkType
local checkType = require('libraryUtil').checkType


Baris 14: Baris 14:
if type(val) ~= 'string' then
if type(val) ~= 'string' then
error(string.format(
error(string.format(
"type error in '%s' parameter of '_main' (expected string, got %s)",
"galat pada '%s' parameter '_main' (expected string, hasil %s)",
key, type(val)
key, type(val)
), level)
), level)
Baris 81: Baris 81:


function p.main(frame)
function p.main(frame)
local origArgs = require('Module:Arguments').getArgs(frame, {
local origArgs = require('Modul:Arguments').getArgs(frame, {
wrappers = 'Template:File link'
wrappers = 'Templat:File link'
})
})
if not origArgs.file then
if not origArgs.file then
error("'file' parameter missing from [[Template:File link]]", 0)
error("parameter 'file' hilang dari [[Templat:File link]]", 0)
end
end