@pluralsight/ps-design-system-util
Advanced tools
Comparing version 9.3.1 to 9.4.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [9.4.0](https://github.com/pluralsight/design-system/compare/@pluralsight/ps-design-system-util@9.3.1...@pluralsight/ps-design-system-util@9.4.0) (2021-09-03) | ||
### Features | ||
* **util:** add generateId based on counter ([8a3ca71](https://github.com/pluralsight/design-system/commit/8a3ca7189e1fead9a14619bb3e13a3c846a0e654)) | ||
## [9.3.1](https://github.com/pluralsight/design-system/compare/@pluralsight/ps-design-system-util@9.3.0...@pluralsight/ps-design-system-util@9.3.1) (2021-08-12) | ||
@@ -8,0 +19,0 @@ |
@@ -25,3 +25,3 @@ export * from './jest'; | ||
export * from './styles'; | ||
export { uniqueId } from './unique-id'; | ||
export * from './unique-id'; | ||
export { onClickOutside, onGlobalEventsClose, onResize, onScrollOutside, useClickOutside, useCloseOnDocumentEvents, useResize, useScrollOutside } from './use-close-on-document-events'; | ||
@@ -28,0 +28,0 @@ export { useCombinedRefs } from './use-combined-refs'; |
@@ -57,4 +57,3 @@ "use strict"; | ||
__exportStar(require("./styles"), exports); | ||
var unique_id_1 = require("./unique-id"); | ||
Object.defineProperty(exports, "uniqueId", { enumerable: true, get: function () { return unique_id_1.uniqueId; } }); | ||
__exportStar(require("./unique-id"), exports); | ||
var use_close_on_document_events_1 = require("./use-close-on-document-events"); | ||
@@ -61,0 +60,0 @@ Object.defineProperty(exports, "onClickOutside", { enumerable: true, get: function () { return use_close_on_document_events_1.onClickOutside; } }); |
export declare const uniqueId: (prefix?: string) => string; | ||
export declare const generateId: (prefix?: string) => string; | ||
export declare const setIdCounter: (num: number) => void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.uniqueId = void 0; | ||
exports.setIdCounter = exports.generateId = exports.uniqueId = void 0; | ||
exports.uniqueId = function (prefix) { | ||
@@ -9,2 +9,10 @@ if (prefix === void 0) { prefix = ''; } | ||
}; | ||
var idCounter = 0; | ||
exports.generateId = function (prefix) { | ||
if (prefix === void 0) { prefix = ''; } | ||
return prefix + String(idCounter++); | ||
}; | ||
exports.setIdCounter = function (num) { | ||
idCounter = num; | ||
}; | ||
//# sourceMappingURL=unique-id.js.map |
@@ -25,3 +25,3 @@ export * from './jest'; | ||
export * from './styles'; | ||
export { uniqueId } from './unique-id'; | ||
export * from './unique-id'; | ||
export { onClickOutside, onGlobalEventsClose, onResize, onScrollOutside, useClickOutside, useCloseOnDocumentEvents, useResize, useScrollOutside } from './use-close-on-document-events'; | ||
@@ -28,0 +28,0 @@ export { useCombinedRefs } from './use-combined-refs'; |
@@ -25,3 +25,3 @@ export * from './jest'; | ||
export * from './styles'; | ||
export { uniqueId } from './unique-id'; | ||
export * from './unique-id'; | ||
export { onClickOutside, onGlobalEventsClose, onResize, onScrollOutside, useClickOutside, useCloseOnDocumentEvents, useResize, useScrollOutside } from './use-close-on-document-events'; | ||
@@ -28,0 +28,0 @@ export { useCombinedRefs } from './use-combined-refs'; |
export declare const uniqueId: (prefix?: string) => string; | ||
export declare const generateId: (prefix?: string) => string; | ||
export declare const setIdCounter: (num: number) => void; |
@@ -6,2 +6,10 @@ export var uniqueId = function (prefix) { | ||
}; | ||
var idCounter = 0; | ||
export var generateId = function (prefix) { | ||
if (prefix === void 0) { prefix = ''; } | ||
return prefix + String(idCounter++); | ||
}; | ||
export var setIdCounter = function (num) { | ||
idCounter = num; | ||
}; | ||
//# sourceMappingURL=unique-id.js.map |
{ | ||
"name": "@pluralsight/ps-design-system-util", | ||
"version": "9.3.1", | ||
"version": "9.4.0", | ||
"description": "Runtime dependencies for utilitarian tasks. Analogous to a lodash.", | ||
@@ -39,3 +39,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "9c8a86eb9b09ac3804636f3e701726fb8065fd21" | ||
"gitHead": "121f57de0000acac3a1b956f2a87cf145d6ee293" | ||
} |
@@ -26,3 +26,3 @@ export * from './jest' | ||
export * from './styles' | ||
export { uniqueId } from './unique-id' | ||
export * from './unique-id' | ||
@@ -29,0 +29,0 @@ export { |
@@ -5,1 +5,11 @@ export const uniqueId = (prefix = '') => { | ||
} | ||
let idCounter = 0 | ||
export const generateId = (prefix = '') => { | ||
return prefix + String(idCounter++) | ||
} | ||
export const setIdCounter = (num: number) => { | ||
idCounter = num | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
245810
3591