當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript coreutils.uuid函數代碼示例

本文整理匯總了TypeScript中@jupyterlab/coreutils.uuid函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript uuid函數的具體用法?TypeScript uuid怎麽用?TypeScript uuid使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了uuid函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createSessionModel

/**
 * Create a unique session id.
 */
function createSessionModel(id = ''): Session.IModel {
  return {
    id: id || uuid(),
    notebook: { path: uuid() },
    kernel: { id: uuid(), name: uuid() }
  };
}
開發者ID:eskirk,項目名稱:jupyterlab,代碼行數:10,代碼來源:manager.spec.ts

示例2: it

    it('should not be emitted for an iopub signal', async () => {
      const kernel = await tester.start();

      // We'll send two messages, first an iopub message, then a shell message.
      // The unhandledMessage signal should only emit once for the shell message.
      const msgId = uuid();
      const emission = testEmission(kernel.unhandledMessage, {
        test: (k, msg) => { expect(msg.header.msg_id).to.be(msgId); }
      });

      // Send an iopub message.
      tester.sendStatus(uuid(), 'idle');

      // Send a shell message.
      let msg = KernelMessage.createShellMessage({
        msgType: 'foo',
        channel: 'shell',
        session: tester.serverSessionId,
        msgId
      });
      msg.parent_header = {session: kernel.clientId};
      tester.send(msg);

      await emission;
    });
開發者ID:groutr,項目名稱:jupyterlab,代碼行數:25,代碼來源:ikernel.spec.ts

示例3: it

 it('should generate a random 32 character hex string', () => {
   let id0 = uuid();
   let id1 = uuid();
   expect(id0.length).to.equal(32);
   expect(id1.length).to.equal(32);
   expect(id0).to.not.equal(id1);
 });
開發者ID:7125messi,項目名稱:jupyterlab,代碼行數:7,代碼來源:uuid.spec.ts

示例4: createSessionModel

/**
 * Create a unique session id.
 */
function createSessionModel(id = ''): Session.IModel {
  return {
    id: id || uuid(),
    path: uuid(),
    type: '',
    name: '',
    kernel: { id: uuid(), name: uuid() }
  };
}
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:12,代碼來源:manager.spec.ts

示例5: beforeEach

 beforeEach((done) => {
   tester = new KernelTester();
   data = [{ id: uuid(), name: 'test' },
           { id: uuid(), name: 'test2' }];
   tester.runningKernels = data;
   manager = new KernelManager();
   expect(manager.specs).to.be(null);
   expect(manager.running().next()).to.be(void 0);
   manager.ready.then(done, done);
 });
開發者ID:eskirk,項目名稱:jupyterlab,代碼行數:10,代碼來源:manager.spec.ts

示例6: it

 it('should yield a list of valid kernel ids', (done) => {
   let data = [
     { id: uuid(), name: 'test' },
     { id: uuid(), name: 'test2' }
   ];
   tester.runningKernels = data;
   Kernel.listRunning().then(response => {
     let running = toArray(response);
     expect(running[0]).to.eql(data[0]);
     expect(running[1]).to.eql(data[1]);
     done();
   });
 });
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:13,代碼來源:kernel.spec.ts

示例7: createFactory

function createFactory() {
  return new WidgetFactory({
    name: uuid(),
    fileExtensions: ['.txt', '.foo.bar'],
    defaultFor: ['.txt', '.foo.bar']
  });
}
開發者ID:charnpreetsingh185,項目名稱:jupyterlab,代碼行數:7,代碼來源:registry.spec.ts


注:本文中的@jupyterlab/coreutils.uuid函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。