Socket
Socket
Sign inDemoInstall

hoek

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoek - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

8

lib/hoek.js

@@ -329,2 +329,10 @@ // Load modules

// Escape string for Regex construction
exports.escapeRegex = function (string) {
// Escape ^$.*+?=!:|\/()[]{}
return string.replace(/[\^\$\.\*\+\?\=\!\:\|\\\/\(\)\[\]\{\}]/g, '\\$&');
};

2

package.json
{
"name": "hoek",
"description": "General purpose node utilities",
"version": "0.0.7",
"version": "0.0.8",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors":[

@@ -94,2 +94,10 @@ var assert = require('assert');

})
describe("#escapeRegex", function () {
it("should escape all special regular expression characters", function (done) {
var a = hoek.escapeRegex('4^f$s.4*5+_?%=#!:@|~\\/`"(>)[<]d{}s,');
a.should.equal('4\\^f\\$s\\.4\\*5\\+_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s,');
done();
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc