Comparing version 1.2.0 to 1.2.2
@@ -8,18 +8,6 @@ "use strict"; | ||
var _trim = _interopRequireDefault(require("../trim")); | ||
var _trim = _interopRequireDefault(require("./trim")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* @function capitalize | ||
* @description Capitalizes a string | ||
* @param {String} str | ||
* @return {String} | ||
* @example | ||
* capitalize('test') | ||
* // Test | ||
* @example | ||
* str('TEST').capitalize() | ||
* // Tets | ||
*/ | ||
var _default = function _default(str) { | ||
@@ -26,0 +14,0 @@ str = (0, _trim.default)(str); |
15
count.js
@@ -8,17 +8,2 @@ "use strict"; | ||
/** | ||
* @function count | ||
* @description Counts characters in string | ||
* @param {String} str | ||
* @return {Number} Number of characters | ||
* @example | ||
* count('test') | ||
* // 4 | ||
* @example | ||
* str('test').length | ||
* // 4 | ||
* @example | ||
* str('test').count() | ||
* // 4 | ||
*/ | ||
var _default = function _default(str) { | ||
@@ -25,0 +10,0 @@ return String(str).length; |
@@ -8,16 +8,2 @@ "use strict"; | ||
/** | ||
* @function endsWith | ||
* @description Checks if a string ends with the provided substring | ||
* @param {String} str | ||
* @param {String} substring | ||
* @param {Number} [pos=0] Position to start checking. Defaults to 0 | ||
* @return {Boolean} True / False | ||
* @example | ||
* endsWith('test', 'st') | ||
* // true | ||
* @example | ||
* str('test').endsWith('st') | ||
* // true | ||
*/ | ||
var endsWith = function endsWith(str, sub, pos) { | ||
@@ -24,0 +10,0 @@ str = String(str); |
113
index.js
@@ -9,14 +9,2 @@ 'use strict'; | ||
/** | ||
* @function trim | ||
* @description Trims left and right a string | ||
* @param {String} str | ||
* @return {String} Trimmed string | ||
* @example | ||
* trim(' This is a tesT ') | ||
* // This is a tesT | ||
* @example | ||
* str(' This is a tesT ').trim().value | ||
* // This is a tesT | ||
*/ | ||
var trim = function trim(str) { | ||
@@ -26,38 +14,7 @@ return str.replace(/^\s+/, '').replace(/\s+$/, ''); | ||
/** | ||
* @function slugify | ||
* @description Slugifys a string | ||
* @param {String} str | ||
* @param {String} [del=-] Delimiter, defaults to '-' | ||
* @return {String} Slugified string | ||
* @example | ||
* slugify(' This is a tesT ') | ||
* // this-is-a-test | ||
* @example | ||
* slugify(' This is a tesT ', ':') | ||
* // this:is:a:test | ||
* @example | ||
* str(' This is a tesT ').slugify().value | ||
* // this-is-a-test | ||
*/ | ||
var slugify = function slugify(str) { | ||
var sep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-'; | ||
return trim(str).toLowerCase().replace(/ /g, sep) // Cambio espacios por el separador | ||
.normalize('NFD') // Quito todas las tildes | ||
.replace(/[\u0300-\u036f]/g, ''); | ||
return trim(str).toLowerCase().replace(/ /g, sep).normalize('NFD').replace(/[\u0300-\u036f]/g, ''); | ||
}; | ||
/** | ||
* @function lower | ||
* @description Transform str to lower case | ||
* @param {String} str | ||
* @return {String} Lower cased string | ||
* @example | ||
* lower('TEST') | ||
* // test | ||
* @example | ||
* str('TEST').lower().value | ||
* // test | ||
*/ | ||
var lower = (function (str) { | ||
@@ -67,17 +24,2 @@ return str.toLowerCase(); | ||
/** | ||
* @function count | ||
* @description Counts characters in string | ||
* @param {String} str | ||
* @return {Number} Number of characters | ||
* @example | ||
* count('test') | ||
* // 4 | ||
* @example | ||
* str('test').length | ||
* // 4 | ||
* @example | ||
* str('test').count() | ||
* // 4 | ||
*/ | ||
var count = (function (str) { | ||
@@ -87,14 +29,2 @@ return String(str).length; | ||
/** | ||
* @function upper | ||
* @description Transform a string to uppercase | ||
* @param {String} str | ||
* @return {String} Uppercased string | ||
* @example | ||
* upper('test') | ||
* // TEST | ||
* @example | ||
* str('test').upper().value | ||
* // TEST | ||
*/ | ||
var upper = (function (str) { | ||
@@ -104,16 +34,2 @@ return String(str).toUpperCase(); | ||
/** | ||
* @function startsWith | ||
* @description Checks if a string starts with the provided substring | ||
* @param {String} str | ||
* @param {String} substring | ||
* @param {Number} [pos=0] Position to start checking. Defaults to 0 | ||
* @return {Boolean} True / False | ||
* @example | ||
* startsWith('test', 'te') | ||
* // true | ||
* @example | ||
* str('test').startsWith('te') | ||
* // true | ||
*/ | ||
var startsWith = (function (str, sub) { | ||
@@ -124,16 +40,2 @@ var pos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
/** | ||
* @function endsWith | ||
* @description Checks if a string ends with the provided substring | ||
* @param {String} str | ||
* @param {String} substring | ||
* @param {Number} [pos=0] Position to start checking. Defaults to 0 | ||
* @return {Boolean} True / False | ||
* @example | ||
* endsWith('test', 'st') | ||
* // true | ||
* @example | ||
* str('test').endsWith('st') | ||
* // true | ||
*/ | ||
var endsWith = function endsWith(str, sub, pos) { | ||
@@ -151,15 +53,2 @@ str = String(str); | ||
/** | ||
* @function capitalize | ||
* @description Capitalizes a string | ||
* @param {String} str | ||
* @return {String} | ||
* @example | ||
* capitalize('test') | ||
* // Test | ||
* @example | ||
* str('TEST').capitalize() | ||
* // Tets | ||
*/ | ||
var capitalize = (function (str) { | ||
@@ -166,0 +55,0 @@ str = trim(str); |
12
lower.js
@@ -8,14 +8,2 @@ "use strict"; | ||
/** | ||
* @function lower | ||
* @description Transform str to lower case | ||
* @param {String} str | ||
* @return {String} Lower cased string | ||
* @example | ||
* lower('TEST') | ||
* // test | ||
* @example | ||
* str('TEST').lower().value | ||
* // test | ||
*/ | ||
var _default = function _default(str) { | ||
@@ -22,0 +10,0 @@ return str.toLowerCase(); |
{ | ||
"name": "str", | ||
"version": "1.2.0", | ||
"version": "1.2.2", | ||
"description": "", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"build:docs": "rm -fr ./docs && jsdoc -c .jsdoc.json -R ./README.md", | ||
"postbuild:docs": "git add . && git com -am 'Deploy' && git push && npm version patch -m 'fix build' && npm publish ./dist", | ||
"postbuild:docs": "git add . && git com -am 'Deploy' && git push && npm version patch -m 'fix individual methods import' && npm publish ./dist", | ||
"deploy": "npm run build:code", | ||
@@ -40,2 +40,3 @@ "predeploy": "npm test", | ||
"babel-plugin-add-module-exports": "^1.0.0", | ||
"babel-plugin-transform-import-paths": "^1.0.1", | ||
"chai": "^4.2.0", | ||
@@ -42,0 +43,0 @@ "codecov": "^3.1.0", |
@@ -8,27 +8,9 @@ "use strict"; | ||
var _trim = _interopRequireDefault(require("../trim")); | ||
var _trim = _interopRequireDefault(require("./trim")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* @function slugify | ||
* @description Slugifys a string | ||
* @param {String} str | ||
* @param {String} [del=-] Delimiter, defaults to '-' | ||
* @return {String} Slugified string | ||
* @example | ||
* slugify(' This is a tesT ') | ||
* // this-is-a-test | ||
* @example | ||
* slugify(' This is a tesT ', ':') | ||
* // this:is:a:test | ||
* @example | ||
* str(' This is a tesT ').slugify().value | ||
* // this-is-a-test | ||
*/ | ||
var slugify = function slugify(str) { | ||
var sep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-'; | ||
return (0, _trim.default)(str).toLowerCase().replace(/ /g, sep) // Cambio espacios por el separador | ||
.normalize('NFD') // Quito todas las tildes | ||
.replace(/[\u0300-\u036f]/g, ''); | ||
return (0, _trim.default)(str).toLowerCase().replace(/ /g, sep).normalize('NFD').replace(/[\u0300-\u036f]/g, ''); | ||
}; | ||
@@ -35,0 +17,0 @@ |
@@ -8,16 +8,2 @@ "use strict"; | ||
/** | ||
* @function startsWith | ||
* @description Checks if a string starts with the provided substring | ||
* @param {String} str | ||
* @param {String} substring | ||
* @param {Number} [pos=0] Position to start checking. Defaults to 0 | ||
* @return {Boolean} True / False | ||
* @example | ||
* startsWith('test', 'te') | ||
* // true | ||
* @example | ||
* str('test').startsWith('te') | ||
* // true | ||
*/ | ||
var _default = function _default(str, sub) { | ||
@@ -24,0 +10,0 @@ var pos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; |
12
trim.js
@@ -8,14 +8,2 @@ "use strict"; | ||
/** | ||
* @function trim | ||
* @description Trims left and right a string | ||
* @param {String} str | ||
* @return {String} Trimmed string | ||
* @example | ||
* trim(' This is a tesT ') | ||
* // This is a tesT | ||
* @example | ||
* str(' This is a tesT ').trim().value | ||
* // This is a tesT | ||
*/ | ||
var trim = function trim(str) { | ||
@@ -22,0 +10,0 @@ return str.replace(/^\s+/, '').replace(/\s+$/, ''); |
12
upper.js
@@ -8,14 +8,2 @@ "use strict"; | ||
/** | ||
* @function upper | ||
* @description Transform a string to uppercase | ||
* @param {String} str | ||
* @return {String} Uppercased string | ||
* @example | ||
* upper('test') | ||
* // TEST | ||
* @example | ||
* str('test').upper().value | ||
* // TEST | ||
*/ | ||
var _default = function _default(str) { | ||
@@ -22,0 +10,0 @@ return String(str).toUpperCase(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17544
26
246