JSPM

shortstop-regex

0.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q37625F
    • License MIT

    shortstop handler to support regular expressions

    Package Exports

    • shortstop-regex

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shortstop-regex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    shortstop-regex

    Build Status

    Adds RegExp support to shortstop.

    Example

    'use strict';
    var shortstop = require('shortstop');
    var resolver = shortstop.create();
    var assert = require('assert');
    
    var shortstopRegex = require('shortstop-regex');
    
    resolver.use('regex', shortstopRegex());
    
    var data = {
      'isSecure': 'regex:^\/secure\/'
    };
    
    resolver.resolve(data, function (err, result) {
      assert.equal(result.isSecure.test('/secure/route'), true);
      assert.equal(result.isSecure.test('/notSecure/route'), false);
    });