4.4.0 • Published 9 months ago
@contrast/distringuish v4.4.0
@contrast/distringuish
Node native module for tracking string literals with string externalization.
See this article for technical details.
Usage
const distringuish = require('@contrast/distringuish');
const externalString = distringuish.externalize(someString);
const props = distringuish.getProperties(externalString); // => {}
props.key = 'value';
// the object returned maintains properties pinned to the string
distringuish.getProperties(externalString); // => { key: "value" }
API
See index.d.ts.
externalize(str: string, props: Object): string | number;
getProperties(str: string): Record<string, any> | null;
isExternal(str: string): boolean;
internalize(str: string): string;
Building locally
npm run build
will build the project for your current OS and architecture.
npm run build:dev
passes the --debug
flag which can be useful during
development.
npm run download
will pull the most recent build artifacts from GitHub.
Publishing
Simply run npm version
and git push && git push --tags
.
CI will take care of releasing on tagged commits.
Style Guide
See .clang-format.
- 4 spaces for indentation
- open curly brace goes on the same line as the statement