Sha256: a5d0ad79a66f8b0fee891c55e5f790c7bed14097adcaf144155d0648f6a0d979

Contents?: true

Size: 1.44 KB

Versions: 10

Compression:

Stored size: 1.44 KB

Contents

'use strict';

var chars = {};

/**
 * Regex for common characters
 */

chars.escapeRegex = {
  '?': /\?/g,
  '@': /\@/g,
  '!': /\!/g,
  '+': /\+/g,
  '*': /\*/g,
  '(': /\(/g,
  ')': /\)/g,
  '[': /\[/g,
  ']': /\]/g,
};

/**
 * Escape characters
 */

chars.ESC = {
  '?': '__UNESC_QMRK__',
  '@': '__UNESC_AMPE__',
  '!': '__UNESC_EXCL__',
  '+': '__UNESC_PLUS__',
  '*': '__UNESC_STAR__',
  ',': '__UNESC_COMMA__',
  '(': '__UNESC_LTPAREN__',
  ')': '__UNESC_RTPAREN__',
  '[': '__UNESC_LTBRACK__',
  ']': '__UNESC_RTBRACK__',
};

/**
 * Unescape characters
 */

chars.UNESC = {
  '__UNESC_QMRK__'   : '\\?',
  '__UNESC_AMPE__'   : '\\@',
  '__UNESC_EXCL__'   : '\\!',
  '__UNESC_PLUS__'   : '\\+',
  '__UNESC_STAR__'   : '\\*',
  '__UNESC_COMMA__'  : '\\*',
  '__UNESC_LTPAREN__': '\\(',
  '__UNESC_RTPAREN__': '\\)',
  '__UNESC_LTBRACK__': '\\[',
  '__UNESC_RTBRACK__': '\\]',
};

chars.ESC_TEMP = {
  '?': '__TEMP_QMRK__',
  '@': '__TEMP_AMPE__',
  '!': '__TEMP_EXCL__',
  '*': '__TEMP_STAR__',
  '+': '__TEMP_PLUS__',
  ',': '__TEMP_COMMA__',
  '(': '__TEMP_LTPAREN__',
  ')': '__TEMP_RTPAREN__',
  '[': '__TEMP_LTBRACK__',
  ']': '__TEMP_RTBRACK__',
};

chars.TEMP = {
  '__TEMP_QMRK__'   : '?',
  '__TEMP_AMPE__'   : '@',
  '__TEMP_EXCL__'   : '!',
  '__TEMP_STAR__'   : '*',
  '__TEMP_PLUS__'   : '+',
  '__TEMP_COMMA__'  : ',',
  '__TEMP_LTPAREN__': '(',
  '__TEMP_RTPAREN__': ')',
  '__TEMP_LTBRACK__': '[',
  '__TEMP_RTBRACK__': ']',
};

module.exports = chars;

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/lib/chars.js