@instructure/uid 11.6.0 → 11.6.1-pr-snapshot-1779894247159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/{lib/index.js → babel.config.cjs} +14 -14
- package/package.json +4 -6
- package/lib/package.json +0 -1
- package/lib/uid.js +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/uid
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/uid
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
Object.defineProperty(exports, "uid", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _uid.uid;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _uid = require("./uid");
|
|
14
1
|
/*
|
|
15
2
|
* The MIT License (MIT)
|
|
16
3
|
*
|
|
@@ -34,4 +21,17 @@ var _uid = require("./uid");
|
|
|
34
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
22
|
* SOFTWARE.
|
|
36
23
|
*/
|
|
37
|
-
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
presets: [
|
|
27
|
+
[
|
|
28
|
+
require('@instructure/ui-babel-preset'),
|
|
29
|
+
{
|
|
30
|
+
coverage: Boolean(process.env.COVERAGE),
|
|
31
|
+
esModules: Boolean(process.env.ES_MODULES),
|
|
32
|
+
removeConsole: process.env.NODE_ENV === 'production',
|
|
33
|
+
transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/uid",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.1-pr-snapshot-1779894247159",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "A unique (CSS-safe) id generator made by Instructure Inc.",
|
|
5
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
7
|
"module": "./es/index.js",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@testing-library/jest-dom": "^6.6.3",
|
|
21
21
|
"vitest": "^3.2.2",
|
|
22
|
-
"@instructure/ui-babel-preset": "11.6.
|
|
22
|
+
"@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
@@ -29,10 +29,8 @@
|
|
|
29
29
|
".": {
|
|
30
30
|
"types": "./types/index.d.ts",
|
|
31
31
|
"import": "./es/index.js",
|
|
32
|
-
"require": "./lib/index.js",
|
|
33
32
|
"default": "./es/index.js"
|
|
34
33
|
},
|
|
35
|
-
"./lib/*": "./lib/*",
|
|
36
34
|
"./es/*": "./es/*",
|
|
37
35
|
"./types/*": "./types/*",
|
|
38
36
|
"./package.json": "./package.json",
|
|
@@ -42,7 +40,7 @@
|
|
|
42
40
|
"lint": "ui-scripts lint",
|
|
43
41
|
"lint:fix": "ui-scripts lint --fix",
|
|
44
42
|
"clean": "ui-scripts clean",
|
|
45
|
-
"build": "ui-scripts build
|
|
43
|
+
"build": "ui-scripts build",
|
|
46
44
|
"build:watch": "ui-scripts build --watch",
|
|
47
45
|
"build:types": "tsc -p tsconfig.build.json"
|
|
48
46
|
}
|
package/lib/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
package/lib/uid.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
exports.uid = uid;
|
|
8
|
-
/*
|
|
9
|
-
* The MIT License (MIT)
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
-
*
|
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
-
* furnished to do so, subject to the following conditions:
|
|
19
|
-
*
|
|
20
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
-
* copies or substantial portions of the Software.
|
|
22
|
-
*
|
|
23
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
-
* SOFTWARE.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
// based on: https://github.com/ai/nanoid/blob/main/non-secure/index.js
|
|
33
|
-
|
|
34
|
-
const dictionary = 'getRandomVcryp0123456789bfhijklqsuvwxzABCDEFGHIJKLMNOPQSTUWXYZ';
|
|
35
|
-
const dictionaryLengthMinus1 = dictionary.length - 1;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* ---
|
|
39
|
-
* category: utilities/utils
|
|
40
|
-
* ---
|
|
41
|
-
* Generate a unique (CSS-safe) id string
|
|
42
|
-
*
|
|
43
|
-
* @module uid
|
|
44
|
-
* @param {String} prefix a string to prefix the id for debugging in non-production env
|
|
45
|
-
* @param {Number} length id length (in characters, minus the prefix). Default is 12
|
|
46
|
-
* @returns {String} a unique id
|
|
47
|
-
*/
|
|
48
|
-
function uid(prefix = '', length = 12) {
|
|
49
|
-
const id = `u${_uid(length - 1)}`;
|
|
50
|
-
if (prefix && process.env.NODE_ENV !== 'production') {
|
|
51
|
-
return `${prefix}__${id}`;
|
|
52
|
-
} else {
|
|
53
|
-
return id;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function _random(size) {
|
|
57
|
-
const result = [];
|
|
58
|
-
/* eslint-disable-next-line no-param-reassign */
|
|
59
|
-
while (0 < size--) {
|
|
60
|
-
// `| 0` is faster than `Math.floor()`.
|
|
61
|
-
result.push(Math.random() * 256 | 0);
|
|
62
|
-
}
|
|
63
|
-
return result;
|
|
64
|
-
}
|
|
65
|
-
function _uid(idLength) {
|
|
66
|
-
let id = '';
|
|
67
|
-
const bytes = _random(idLength);
|
|
68
|
-
/* eslint-disable-next-line no-param-reassign */
|
|
69
|
-
while (0 < idLength--) {
|
|
70
|
-
id += dictionary[bytes[idLength] & dictionaryLengthMinus1];
|
|
71
|
-
}
|
|
72
|
-
return id;
|
|
73
|
-
}
|
|
74
|
-
var _default = exports.default = uid;
|