machinepack-strings
Advanced tools
Comparing version
@@ -22,12 +22,12 @@ module.exports = { | ||
description: 'The style of random string to generate.', | ||
extendedDescription: `This can be either "alphanumeric" (the default) or "url-friendly". | ||
• When "alphanumeric", it means the result string will consist only of numerals [0-9] | ||
and lowercase letters [a-f]. | ||
• When "url-friendly", it means the result string will have other characters as well, | ||
but it is always guaranteed to work properly within the querystring of a URL. | ||
Also note that, when using this style of random string, you needn\'t worry about | ||
additional URI-decoding -- in other words, running decodeURI() or decodeURIComponent() | ||
on the resulting random string won't have any effect.`, | ||
extendedDescription: 'This can be either "alphanumeric" (the default) or "url-friendly".\n'+ | ||
'\n'+ | ||
'• When "alphanumeric", it means the result string will consist only of numerals [0-9]\n'+ | ||
'and lowercase letters [a-f].\n'+ | ||
'\n'+ | ||
'• When "url-friendly", it means the result string will have other characters as well,\n'+ | ||
'but it is always guaranteed to work properly within the querystring of a URL.\n'+ | ||
'Also note that, when using this style of random string, you needn\'t worry about\n'+ | ||
'additional URI-decoding -- in other words, running decodeURI() or decodeURIComponent()\n'+ | ||
'on the resulting random string won\'t have any effect.', | ||
// isIn: ['url-friendly', 'alphanumeric'], | ||
@@ -97,5 +97,5 @@ type: 'string', | ||
for (var i = 0; i < Math.floor(digits); i++) { | ||
var x = Math.floor(Math.random() * base).toString(base); | ||
result = x + result; | ||
for (i = 0; i < Math.floor(digits); i++) { | ||
var x1 = Math.floor(Math.random() * base).toString(base); | ||
result = x1 + result; | ||
} | ||
@@ -105,4 +105,4 @@ | ||
var b = Math.pow(base, rem); | ||
var x = Math.floor(Math.random() * b).toString(base); | ||
result = x + result; | ||
var x2 = Math.floor(Math.random() * b).toString(base); | ||
result = x2 + result; | ||
} | ||
@@ -117,3 +117,3 @@ | ||
})(128, 16);//® | ||
})(128, 16);//‰ | ||
@@ -120,0 +120,0 @@ }else { |
{ | ||
"name": "machinepack-strings", | ||
"version": "6.0.0-1", | ||
"version": "6.0.0", | ||
"description": "Work with strings.", | ||
@@ -28,5 +28,5 @@ "scripts": { | ||
"devDependencies": { | ||
"eslint": "3.19.0", | ||
"eslint": "4.11.0", | ||
"mocha": "3.0.2", | ||
"test-machinepack-mocha": "^2.1.3" | ||
"test-machinepack-mocha": "^3.0.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "browserify": { |
@@ -29,3 +29,3 @@ { | ||
"outcome": "success", | ||
"returns": "34" | ||
"returns": "\"34\"" | ||
}, | ||
@@ -32,0 +32,0 @@ { |
@@ -44,5 +44,5 @@ { | ||
"outcome": "success", | ||
"returns": "235723857239587235" | ||
"returns": "\"235723857239587235\"" | ||
} | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
105417
1.25%2617
0.08%1
-50%