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


TypeScript del.default函數代碼示例

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


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

示例1: pipelineFunction

export default function pipelineFunction(event?: gulp.WatchEvent) {

    if (event !== undefined) {
        if (event.type !== 'deleted') {
            return q();
        }

        const files: string[] = [
            event.path.replace(/\\/g, '/').replace('.ts', '.js'),
            event.path.replace(/\\/g, '/').replace('.ts', '.js.map'),
            event.path.replace(/\\/g, '/').replace('.jade', '.html'),
            event.path.replace(/\\/g, '/').replace('.sass', '.css')
        ];

        return del(files, { force: true });
    } else {
        const files: string[] = [
            new FilePath(root.application.path(), '/**/*.js').toString(),
            new FilePath(root.application.path(), '/**/*.js.map').toString(),
            root.application.views.files().toString(),
            new FilePath(root.application.path(), '/**/*.css').toString()
        ];


        return del(files, { force: true });
    }
};
開發者ID:ibzakharov,項目名稱:angular_project_template,代碼行數:27,代碼來源:purge.ts

示例2: function

/**
 * Deletes all generated files.
 */
export default function (): any {
    "use strict";

    const del = require("del");

    return del([
        `${Constants.folders.dist}/**/*`,
        `${Constants.folders.docs}/${Constants.folders.docsGenerated}/**/*`,
        `${Constants.folders.lib}/**/*`,
        `${Constants.folders.src}/**/*.js`,
        `${Constants.folders.src}/**/*.d.ts`,
        `${Constants.folders.test}/**/*.d.ts`,
        `${Constants.folders.test}/**/*.js`
    ]);
}
開發者ID:FullScreenShenanigans,項目名稱:gulp-shenanigans,代碼行數:18,代碼來源:clean.ts

示例3: reset

  public async reset() {
    this.logWithMetadata(['info', 'optimize:watch_cache'], 'The optimizer watch cache will reset');

    // start by deleting the state file to lower the
    // amount of time that another process might be able to
    // successfully read it once we decide to delete it
    await del(this.statePath);

    // delete everything in optimize/.cache directory
    // except ts-node
    await del(
      await globby(
        [
          normalizePosixPath(this.cachePath),
          `${normalizePosixPath(`!${this.cachePath}/ts-node/**`)}`,
        ],
        { dot: true }
      )
    );

    // delete some empty folder that could be left
    // from the previous cache path reset action
    await deleteEmpty(this.cachePath);

    // delete dlls
    await del(this.dllsPath);

    // re-write new cache state file
    await this.write();

    this.logWithMetadata(['info', 'optimize:watch_cache'], 'The optimizer watch cache has reset');
  }
開發者ID:lucabelluccini,項目名稱:kibana,代碼行數:32,代碼來源:watch_cache.ts

示例4: copyDTSTypings

 function copyDTSTypings(tsFileName: string, srcFolderPath: string, destFolderPath: string): void {
     var srcDTSFilePath: string = path.join(srcFolderPath, tsFileName + ".d.ts");
     var srcJSFilePath: string = path.join(srcFolderPath, tsFileName + ".js");
     var destDTSFilePath: string = path.join(destFolderPath, tsFileName + ".d.ts");
     console.log("copying: " + srcDTSFilePath + " to :" + destDTSFilePath);
     fs.writeFileSync(destDTSFilePath, fs.readFileSync(srcDTSFilePath));   
     del([srcDTSFilePath], { force: true });   
     del([srcJSFilePath], { force: true });        
 }
開發者ID:Dmitry-Kravchuk,項目名稱:TACO,代碼行數:9,代碼來源:tsDefinitionUtil.ts

示例5: deleteTarget

async function deleteTarget(project: Project) {
  const targetDir = project.targetLocation;

  if (await isDirectory(targetDir)) {
    await del(targetDir, { force: true });
  }
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:build_production_projects.ts

示例6: del

beforeEach(async () => {
  await del(TMP);
  await mkdirp(resolve(TMP, 'foo/bar/baz'));
  await mkdirp(resolve(TMP, 'foo/bar/box'));
  await mkdirp(resolve(TMP, 'a/b/c/d/e'));
  await write(resolve(TMP, 'a/bar'), 'foo');
});
開發者ID:austec-automation,項目名稱:kibana,代碼行數:7,代碼來源:scan_delete.test.ts

示例7: del

export async function ScreenshotsProvider({ getService }: FtrProviderContext) {
  const log = getService('log');
  const config = getService('config');
  const browser = getService('browser');

  const SESSION_DIRECTORY = resolve(config.get('screenshots.directory'), 'session');
  const FAILURE_DIRECTORY = resolve(config.get('screenshots.directory'), 'failure');
  const BASELINE_DIRECTORY = resolve(config.get('screenshots.directory'), 'baseline');
  await del([SESSION_DIRECTORY, FAILURE_DIRECTORY]);

  class Screenshots {
    /**
     *
     * @param name {string} name of the file to use for comparison
     * @param updateBaselines {boolean} optional, pass true to update the baseline snapshot.
     * @return {Promise.<number>} Percentage difference between the baseline and the current snapshot.
     */
    async compareAgainstBaseline(name: string, updateBaselines: boolean, el: WebElementWrapper) {
      log.debug('compareAgainstBaseline');
      const sessionPath = resolve(SESSION_DIRECTORY, `${name}.png`);
      await this._take(sessionPath, el);

      const baselinePath = resolve(BASELINE_DIRECTORY, `${name}.png`);
      const failurePath = resolve(FAILURE_DIRECTORY, `${name}.png`);

      if (updateBaselines) {
        log.debug('Updating baseline snapshot');
        await writeFileAsync(baselinePath, readFileSync(sessionPath));
        return 0;
      } else {
        await mkdirAsync(FAILURE_DIRECTORY);
        return await comparePngs(sessionPath, baselinePath, failurePath, SESSION_DIRECTORY, log);
      }
    }

    async take(name: string, el: WebElementWrapper) {
      return await this._take(resolve(SESSION_DIRECTORY, `${name}.png`), el);
    }

    async takeForFailure(name: string, el: WebElementWrapper) {
      await this._take(resolve(FAILURE_DIRECTORY, `${name}.png`), el);
    }

    async _take(path: string, el: WebElementWrapper) {
      try {
        log.info(`Taking screenshot "${path}"`);
        const screenshot = await (el ? el.takeScreenshot() : browser.takeScreenshot());
        await fcb(cb => mkdirp(dirname(path), cb));
        await fcb(cb => writeFile(path, screenshot, 'base64', cb));
      } catch (err) {
        log.error('SCREENSHOT FAILED');
        log.error(err);
      }
    }
  }

  return new Screenshots();
}
開發者ID:elastic,項目名稱:kibana,代碼行數:58,代碼來源:screenshots.ts

示例8: Promise

 return new Promise(function (resolve, reject) {
     del(['.build/'], function (err) {
         if (err) {
             reject(err);
         } else {
             resolve();
         }
     });
 });
開發者ID:AArnott,項目名稱:npm-gulp,代碼行數:9,代碼來源:test.ts

示例9: del

    // -------------------------------------------------------------------------
    // General tasks
    // -------------------------------------------------------------------------

    /**
     * Cleans build folder.
     */
    @Task()
    clean(cb: Function) {
        return del([
            "build/**",
            "!build",
            "!build/package",
            "!build/package/node_modules",
            "!build/package/node_modules/**"
        ], cb);
    }
開發者ID:gitter-badger,項目名稱:class-validator,代碼行數:17,代碼來源:gulpfile.ts

示例10: remove

 public async remove(uri: string): Promise<DeleteWorkerResult> {
   const localPath = RepositoryUtils.repositoryLocalPath(this.repoVolPath, uri);
   try {
     // For now, just `rm -rf`
     await del([localPath], { force: true });
     this.log.info(`Remove local repository ${uri} done.`);
     return {
       uri,
       res: true,
     };
   } catch (error) {
     this.log.error(`Remove local repository ${uri} error: ${error}.`);
     throw error;
   }
 }
開發者ID:elastic,項目名稱:kibana,代碼行數:15,代碼來源:repository_service.ts


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