@instructure/uid
Advanced tools
Comparing version 5.42.0-rc.5 to 5.42.0
@@ -6,11 +6,20 @@ # Change Log | ||
<a name="5.42.0-rc.5"></a> | ||
# [5.42.0-rc.5](https://github.com/instructure/instructure-ui/compare/v5.41.1...v5.42.0-rc.5) (2019-02-08) | ||
<a name="5.42.0"></a> | ||
# [5.42.0](https://github.com/instructure/instructure-ui/compare/v5.41.1...v5.42.0) (2019-02-15) | ||
**Note:** Version bump only for package @instructure/uid | ||
### Features | ||
* **ui-scripts:** add examples and server scripts ([e229eef](https://github.com/instructure/instructure-ui/commit/e229eef)) | ||
* **ui-scripts,ui-test-utils:** add a --mocha option to ui-test ([bd37e2b](https://github.com/instructure/instructure-ui/commit/bd37e2b)) | ||
### Performance Improvements | ||
* **babel-plugin-themeable-styles:** speed up babel transpile ([2df2a22](https://github.com/instructure/instructure-ui/commit/2df2a22)) | ||
<a name="5.41.1"></a> | ||
@@ -17,0 +26,0 @@ ## [5.41.1](https://github.com/instructure/instructure-ui/compare/v5.41.0...v5.41.1) (2019-01-30) |
@@ -35,3 +35,3 @@ /* | ||
* @param {String} prefix a string to prefix the id for debugging in non-production env | ||
* @param {Number} length id length (in characters) | ||
* @param {Number} length id length (in characters, minus the prefix) | ||
* @returns {String} a unique id | ||
@@ -43,9 +43,8 @@ */ | ||
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12; | ||
var id = "u".concat(_uid('', length - 1)); | ||
var id = _uid('', length); | ||
if (prefix && process.env.NODE_ENV !== 'production') { | ||
return "".concat(prefix, "__").concat(id); | ||
} else { | ||
return "uid".concat(id); | ||
return id; | ||
} | ||
@@ -52,0 +51,0 @@ } |
@@ -42,3 +42,3 @@ "use strict"; | ||
* @param {String} prefix a string to prefix the id for debugging in non-production env | ||
* @param {Number} length id length (in characters) | ||
* @param {Number} length id length (in characters, minus the prefix) | ||
* @returns {String} a unique id | ||
@@ -50,9 +50,8 @@ */ | ||
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12; | ||
var id = "u".concat(_uid('', length - 1)); | ||
var id = _uid('', length); | ||
if (prefix && process.env.NODE_ENV !== 'production') { | ||
return "".concat(prefix, "__").concat(id); | ||
} else { | ||
return "uid".concat(id); | ||
return id; | ||
} | ||
@@ -59,0 +58,0 @@ } |
{ | ||
"name": "@instructure/uid", | ||
"version": "5.42.0-rc.5", | ||
"version": "5.42.0", | ||
"description": "A unique (CSS-safe) id generator made by Instructure Inc.", | ||
@@ -15,3 +15,3 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"scripts": { | ||
"test:node": "ui-test --node", | ||
"test": "ui-test --mocha", | ||
"lint": "ui-test --lint", | ||
@@ -25,4 +25,4 @@ "lint:fix": "ui-test --lint --fix", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "^5.42.0-rc.5", | ||
"@instructure/ui-test-utils": "^5.42.0-rc.5" | ||
"@instructure/ui-babel-preset": "^5", | ||
"@instructure/ui-test-utils": "^5" | ||
}, | ||
@@ -35,3 +35,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "1c13111d79198162987b6578bbf69a1d106f8329" | ||
"sideEffects": false | ||
} |
@@ -38,11 +38,11 @@ /* | ||
* @param {String} prefix a string to prefix the id for debugging in non-production env | ||
* @param {Number} length id length (in characters) | ||
* @param {Number} length id length (in characters, minus the prefix) | ||
* @returns {String} a unique id | ||
*/ | ||
export default function uid (prefix = '', length = 12) { | ||
const id = _uid('', length) | ||
const id = `u${_uid('', length - 1)}` | ||
if (prefix && process.env.NODE_ENV !== 'production') { | ||
return `${prefix}__${id}` | ||
} else { | ||
return `uid${id}` | ||
return id | ||
} | ||
@@ -49,0 +49,0 @@ } |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13973
0