Version 1
[yaffs-website] / node_modules / underscore.string / underscored.js
diff --git a/node_modules/underscore.string/underscored.js b/node_modules/underscore.string/underscored.js
new file mode 100644 (file)
index 0000000..b9d1628
--- /dev/null
@@ -0,0 +1,5 @@
+var trim = require('./trim');
+
+module.exports = function underscored(str) {
+  return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
+};