@uzero/rest-path
v2.0.0
Published
Rest path builder.
Downloads
583
Readme
rest-path
Rest path builder.
This library does not have any depencencies.
Usage
const { ID, PLURAL, RELATION, SINGULAR, UNSTE_RELATION } = new RestPathBuilder({
singular: 'cat',
plural: 'cats',
prefix: 'api',
});
ID; // 'api/cat/:id'
SINGULAR; // 'api/cat'
PLURAL; // 'api/cats'
RELATION; // 'api/cat/:id/:rn/:rid'
UNSTE_RELATION; // 'api/cat/:id/:rn'