🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@hsds/utils-id

Package Overview
Dependencies
Maintainers
7
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hsds/utils-id - npm Package Compare versions

Comparing version
9.0.1
to
9.0.2-esm.0
+1
index.esm.d.ts
export * from "./src/index";
// Source
// https://github.com/Shopify/javascript-utilities/blob/master/src/other.ts
function createUniqueIDFactory(prefix = '') {
const index = createUniqueIndexFactory(1);
return prefixOverride => {
const namespace = prefixOverride || prefix || '';
return `${namespace}${index()}`;
};
}
function createUniqueIndexFactory(start = 1) {
let index = typeof start === 'number' ? start : 1;
return () => index++;
}
export { createUniqueIDFactory, createUniqueIndexFactory };
+7
-0

@@ -5,2 +5,9 @@ # Changelog

## [9.0.2-esm.0](https://github.com/helpscout/hsds/compare/utils-id-9.0.1...utils-id-9.0.2-esm.0) (2024-04-10)
### Features
* **workspace:** testing producing plain esm files ([25a69d2](https://github.com/helpscout/hsds/commit/25a69d2ba0671e2c1845a2beccb1f61fa71d4c1e))
## [9.0.1](https://github.com/helpscout/hsds/compare/utils-id-9.0.1-next.4...utils-id-9.0.1) (2024-03-01)

@@ -7,0 +14,0 @@

+4
-3
{
"name": "@hsds/utils-id",
"version": "9.0.1",
"main": "index.cjs",
"type": "commonjs"
"version": "9.0.2-esm.0",
"module": "./index.esm.js",
"type": "module",
"main": "index.cjs"
}
// Source
// https://github.com/Shopify/javascript-utilities/blob/master/src/other.ts
export function createUniqueIDFactory(prefix = '') {
const index = createUniqueIndexFactory(1)
return prefixOverride => {
const namespace = prefixOverride || prefix || ''
return `${namespace}${index()}`
}
}
export function createUniqueIndexFactory(start = 1) {
let index = typeof start === 'number' ? start : 1
return () => index++
}