UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

15 lines (10 loc) 299 B
var lpad = require('../string/lpad'); var toNumber = require('../lang/toNumber'); /** * Add padding zeros if n.length < minLength. */ function pad(n, minLength, char){ n = toNumber(n); return lpad(''+ n, minLength, char || '0'); } module.exports = pad;