PHP Classes

File: toastui/src/js/factory/errorMessage.js

Recommend this page to a friend!
  Classes of Mark de Leon   PHP Document Scanner using SANE or eSCL AirPrint   toastui/src/js/factory/errorMessage.js   Download  
File: toastui/src/js/factory/errorMessage.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Document Scanner using SANE or eSCL AirPrint
Web interface to scan printed documents
Author: By
Last change:
Date: 4 years ago
Size: 778 bytes
 

Contents

Class file image Download
/** * @author NHN Ent. FE Development Team <dl_javascript@nhn.com> * @fileoverview Error-message factory */ import snippet from 'tui-code-snippet'; import {keyMirror} from '../util'; const types = keyMirror( 'UN_IMPLEMENTATION', 'NO_COMPONENT_NAME' ); const messages = { UN_IMPLEMENTATION: 'Should implement a method: ', NO_COMPONENT_NAME: 'Should set a component name' }; const map = { UN_IMPLEMENTATION(methodName) { return messages.UN_IMPLEMENTATION + methodName; }, NO_COMPONENT_NAME() { return messages.NO_COMPONENT_NAME; } }; module.exports = { types: snippet.extend({}, types), create(type, ...args) { type = type.toLowerCase(); const func = map[type]; return func(...args); } };