ongteckwu / typeid-ts Goto Github PK
View Code? Open in Web Editor NEWTypeID UUIDv7 implementation in Typescript (Lib and CLI)
License: Apache License 2.0
TypeID UUIDv7 implementation in Typescript (Lib and CLI)
License: Apache License 2.0
strict=true
in tsconfig./node_modules/typeid-ts/src/lib/basics.ts:6:5
Type error: Variable 'uuidv7' implicitly has type 'any' in some locations where its type cannot be determined.
4 | import { encode } from '../base32.js'
5 |
> 6 | let uuidv7
| ^
7 | (async () => {
8 | const mod = await import('uuidv7')
9 | uuidv7 = mod.uuidv7
error Command failed with exit code 1.
On v0.3.1, seems related to #7
Hi! Not sure if you are using Github issues for this, but I was trying out the project and found that calling generateNew("prefix")
quickly generates the same ID, and I was wondering if this was intentional? I can get around it by using encodeFromUUID
and generating a UUID, but it looks like I lose the locality.
// Example code
new Array(30).fill(0).map((_, i) => {
console.log(generateNew("knot"));
});
Example Output:
knot_1g64w3jc9g6gs2tchncdjjtdsk
knot_1g64w3jc9g6gs2tchncdjjtdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncdk2tdsk
knot_1g64w3jc9g6gs2tchncgr2tdsq
knot_1g64w3jc9g6gs2tchncgr2tdsq
knot_1g64w3jc9g6gs2tchncgr2tdsq
knot_1g64w3jc9g6gs2tchncgr2tdsq
knot_1g64w3jc9g6gs2tchncgrjtdv3
knot_1g64w3jc9g6gs2tchncgrjtdv3
knot_1g64w3jc9g6gs2tchncgrjtdv3
knot_1g64w3jc9g6gs2tchncgrjtdv3
knot_1g64w3jc9g6gs2tchncgrjtdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
knot_1g64w3jc9g6gs2tchncgs2tdv3
I think the 0.3.0 version on npm did not have build
run successfully on it before being published - it's missing the new await-free import method from #7.
If you update a project's dependency to 0.3.0
of this library and install it, then cat node_modules/typeid-ts/build/cjs/src/lib/basics.js
, the old const uuidv7_1 = require("uuidv7");
require method is still there.
It looks like the node version requirements for this package are restricted to just the latest LTS:
"node": ">= 18.12 <19"
Is there some reason for this restriction, i.e. does it not work under older or newer versions of Node? Sure, folks should generally want to be on the latest-available LTS, but actually making that decision should be done by the implementer of the requesting package, unless there's reason why this package wouldn't work under any other node range requirement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.