gram_identity


gram.js API

Globals / gram-identity

Package: gram-identity

(ast)-[identify]->(ast)

Collection of identity generating functions and an AST processing plugin which applies identity to any paths which have none.

How to gram-identity

Install:

npm install @gram-data/gram-builder

Build an AST:

import { node, edge } from '@gram-data/gram-builder';

const left = node('a');
const right = node('b');
const ast = edge([left, right], 'right');

Next Steps

Index

References

Interfaces

Type aliases

Functions

Object literals

References

IdentityPluginSettings

Re-exports: IdentityPluginSettings


alphabets

Re-exports: alphabets


counterIDGenerator

Re-exports: counterIDGenerator


gramIdentityPlugin

Re-exports: gramIdentityPlugin


nanoidGenerator

Re-exports: nanoidGenerator

Type aliases

IDGenerator

Ƭ IDGenerator: { generate: () => string }

Defined in packages/gram-identity/src/generator-type.ts:2

Type declaration:

Name Type
generate () => string

Functions

counterIDGenerator

ConstcounterIDGenerator(prefix?: undefined | string): IDGenerator

Defined in packages/gram-identity/src/counter-generator.ts:7

Creates an IDGenerator based on incrementing numbers.

Parameters:

Name Type
prefix? undefined | string

Returns: IDGenerator


gramIdentityPlugin

ConstgramIdentityPlugin(settings: IdentityPluginSettings): Transformer

Defined in packages/gram-identity/src/gram-identity-plugin.ts:24

Parameters:

Name Type
settings IdentityPluginSettings

Returns: Transformer


nanoidGenerator

ConstnanoidGenerator(alphabet?: string, size?: number, prefix?: undefined | string): IDGenerator

Defined in packages/gram-identity/src/nanoid-generator.ts:10

Factory for creating an IDGenerator based on nanoid

Parameters:

Name Type Default value
alphabet string alphabets.base64
size number 21
prefix? undefined | string -

Returns: IDGenerator

Object literals

alphabets

Const alphabets: object

Defined in packages/gram-identity/src/identity-alphabets.ts:1

Properties:

Name Type Value
astrologyBase12 string “♈︎♉︎♊︎♋︎♌︎♍︎♎︎♏︎♐︎♑︎♒︎♓︎”
base10 string “0123456789”
base11 string “0123456789a”
base16 string “0123456789abcdef”
base2 string “01”
base32 string “ABCDEFGHIJKLMNOPQRSTUVWXYZ234567”
base32Hex string “0123456789ABCDEFGHIJKLMNOPQRSTUV”
base36 string “0123456789abcdefghijklmnopqrstuvwxyz”
base58 string “123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ”
base62 string “0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”
base64 string “0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@”
base8 string “01234567”
cards56 string “🂡🂢🂣🂤🂥🂦🂧🂨🂩🂪🂫🂬🂭🂮🂱🂲🂳🂴🂵🂶🂷🂸🂹🂺🂻🂼🂽🂾🃁🃂🃃🃄🃅🃆🃇🃈🃉🃊🃋🃌🃍🃎🃑🃒🃓🃔🃕🃖🃗🃘🃙🃝🃞”
chessBase12 string “♚♛♜♝♞♟♔♕♖♗♘♙”
cookieBase90 string “0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&’()*+-./:<=>?@[]^_`{|}~”
crock32 string “0123456789ABCDEFGHJKMNPQRSTVWXYZ”
dieBase6 string “⚀⚁⚂⚃⚄⚅”
dominoBase28 string “🁣🁤🁫🁥🁬🁳🁦🁭🁴🁻🁧🁮🁵🁼🂃🁨🁯🁶🁽🂊🂋🁩🁰🁷🁾🂅🂌🂓”
flickrBase58 string “123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ”
mahjongBase43 string “🀑🀒🀓🀔🀕🀖🀗🀘🀙🀚🀛🀜🀝🀞🀟🀠🀡🀇🀈🀉🀊🀋🀌🀍🀎🀏🀀🀁🀂🀃🀄︎🀅🀆🀐🀢🀣🀤🀥🀦🀧🀨🀩🀪”
zBase32 string “ybndrfg8ejkmcpqxot1uwisza345h769”