How to use the uuid/v4.default function in uuid

To help you get started, we’ve selected a few uuid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aronallen / cycle-sandbox / src / main.ts View on Github external
const sandbox = (
      resource: string,
      sources: Sources,
      connectors: MainConnectors = {}
    ) => {
      let channels: MessageChannels;
      let subscription: FantasySubscription;
      let worker: Worker;
      let receivePorts: MessagePorts = {};
      let rafSubscription: FantasySubscription;
      const instanceId = uuid();
      return adapt(xs.create({
        start(observer) {
          const sourceKeys = Object.keys(sources);
          channels = createChannels(sourceKeys);
          // { DOM: channel}

          worker = open(resource);




          // make a object of destination ports (rx in thread) wiil be transfered to thread
          const transferPorts = portMap(channels, 2);

          // make a object of entry ports (tx in main)
          const sendPorts = portMap(channels, 1);
github actions / cache / src / utils / actionUtils.ts View on Github external
if (!tempDirectory) {
        let baseLocation: string;
        if (IS_WINDOWS) {
            // On Windows use the USERPROFILE env variable
            baseLocation = process.env["USERPROFILE"] || "C:\\";
        } else {
            if (process.platform === "darwin") {
                baseLocation = "/Users";
            } else {
                baseLocation = "/home";
            }
        }
        tempDirectory = path.join(baseLocation, "actions", "temp");
    }
    const dest = path.join(tempDirectory, uuidV4.default());
    await io.mkdirP(dest);
    return dest;
}
github DFEAGILEDEVOPS / MTC / tslib / src / tests-integration / redis-service.integration.spec.ts View on Github external
test('returns null when redis item is not found', async () => {
    const randomCacheKey = uuid.default()
    const response = await sut.get(randomCacheKey)
    expect(response).toBeUndefined()
  })
})
github aronallen / cycle-sandbox / src / dom / worker.ts View on Github external
events: (events: string, options?: WorkerEventFnOptions): Stream => {
          const listenerId = uuid();
          let subscription: Subscription;
          return adapt(xs.create({
            start(observer) {
              const attachMessage = {
                cmd: WorkerDOMMessageCommand.attach,
                payload: {
                  selector: selector,
                  events: events,
                  options: options,
                  listenerId
                }
              }
              tx.postMessage(attachMessage);
              subscription = fromEvent(rx, 'message')
                .filter(e => (e.data as WorkerDOMEvent).listenerId === listenerId)
                .subscribe({
github L-Leite / cso2-master-server / src / servermanager.ts View on Github external
private static generateUuid(): string {
        return uuidv4.default()
    }
}
github MyScript / MyScriptJS / src / recognizer / websocket / v4 / Cdkv4WSIInkRecognizer.js View on Github external
export function import_(recognizerContext, model, data, callback) {
  const recognitionContext = {
    model,
    callback: (err, res) => iinkCallback(model, err, res, callback),
    importFileId: uuid.default()
  };
  const recognizerContextRef = RecognizerContext.setRecognitionContext(recognizerContext, recognitionContext);

  const chunkSize = recognizerContext.editor.configuration.recognitionParams.server.websocket.fileChunkSize;

  for (let i = 0; i < data.size; i += chunkSize) {
    if (i === 0) {
      CdkWSRecognizerUtil.sendMessage(recognizerContextRef, buildImportFile, recognitionContext.importFileId, data.type)
        .catch(exception => CdkWSRecognizerUtil.retry(import_, recognizerContext, model, data, callback));
    }
    const blobPart = data.slice(i, chunkSize, data.type);
    readBlob(blobPart).then((res) => {
      CdkWSRecognizerUtil.sendMessage(recognizerContextRef, buildImportChunk, recognitionContext.importFileId, res, i + chunkSize > data.size)
        .catch(exception => CdkWSRecognizerUtil.retry(import_, recognizerContext, model, data, callback));
    });
  }
github zotoio / github-task-manager / src / agent / AgentLogger.js View on Github external
import { default as bunyan } from 'bunyan';
import { default as bformat } from 'bunyan-format';
import { default as CWLogsWritable } from 'cwlogs-writable';
import { default as UUID } from 'uuid/v4';
import { default as ExpressSSE } from 'express-sse';
import { default as proxy } from 'proxy-agent';
import { default as bunyanTcp } from 'bunyan-logstash-tcp';

let SSE = [];
let AGENT_ID = UUID();
let STREAM = [];
let LOG = process.env.NODE_ENV === 'test' ? console : create(AGENT_ID);
let STREAM_USER_LAST_ACTIVITY = Date.now();

let CWLogFilterEventStream = require('smoketail').CWLogFilterEventStream;
let janitorInterval;

function getLogGroupMap() {
    let logGroupMap = {};
    logGroupMap['gtmGithubHook'] = '/aws/lambda/gtmGithubHook-dev-gtmGithubHook';
    logGroupMap['gtmGithubResults'] = '/aws/lambda/gtmGithubHook-dev-gtmGithubResults';
    logGroupMap['gtmAgent'] = process.env.GTM_AGENT_CLOUDWATCH_LOGS_GROUP || 'gtmAgent';
    return logGroupMap;
}

function create(agentId) {