当前位置: 首页>>代码示例>>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;未经允许,请勿转载。