当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript path.join函数代码示例

本文整理汇总了TypeScript中path.join函数的典型用法代码示例。如果您正苦于以下问题:TypeScript join函数的具体用法?TypeScript join怎么用?TypeScript join使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了join函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: config

 private config() {
   this.app.set('views', path.join(__dirname, 'views'));
   this.app.set('view engine', 'hbs');
 }
开发者ID:sestrella,项目名称:express-example,代码行数:4,代码来源:app.ts

示例2: remove

 projectDirCreated: projectDir => remove(path.join(projectDir, "build")),
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:1,代码来源:dmgTest.ts

示例3: expect

 packed: async context => {
   expect(platformPackager.effectiveDistOptions.background).toEqual(customBackground)
   expect(platformPackager.effectiveDistOptions.icon).toEqual("foo.icns")
   expect(await platformPackager.getIconPath()).toEqual(path.join(context.projectDir, "customIcon.icns"))
 },
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:5,代码来源:dmgTest.ts

示例4: suite

suite('Node Debug Adapter', () => {

	const DEBUG_ADAPTER = './out/mockDebug.js';

	const PROJECT_ROOT = Path.join(__dirname, '../../');
	const DATA_ROOT = Path.join(PROJECT_ROOT, 'src/tests/data/');


	let dc: DebugClient;

	setup( () => {
		dc = new DebugClient('node', DEBUG_ADAPTER, 'mock');
		return dc.start();
	});

	teardown( () => dc.stop() );


	suite('basic', () => {

		test('unknown request should produce error', done => {
			dc.send('illegal_request').then(() => {
				done(new Error("does not report error on unknown request"));
			}).catch(() => {
				done();
			});
		});
	});

	suite('initialize', () => {

		test('should return supported features', () => {
			return dc.initializeRequest().then(response => {
				assert.equal(response.body.supportsConfigurationDoneRequest, true);
			});
		});

		test('should produce error for invalid \'pathFormat\'', done => {
			dc.initializeRequest({
				adapterID: 'mock',
				linesStartAt1: true,
				columnsStartAt1: true,
				pathFormat: 'url'
			}).then(response => {
				done(new Error("does not report error on invalid 'pathFormat' attribute"));
			}).catch(err => {
				// error expected
				done();
			});
		});
	});

	suite('launch', () => {

		test('should run program to the end', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'test.md');

			return Promise.all([
				dc.configurationSequence(),
				dc.launch({ program: PROGRAM }),
				dc.waitForEvent('terminated')
			]);
		});

		test('should stop on entry', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'test.md');
			const ENTRY_LINE = 1;

			return Promise.all([
				dc.configurationSequence(),
				dc.launch({ program: PROGRAM, stopOnEntry: true }),
				dc.assertStoppedLocation('entry', { line: ENTRY_LINE } )
			]);
		});
	});

	suite('setBreakpoints', () => {

		test('should stop on a breakpoint', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'test.md');
			const BREAKPOINT_LINE = 2;

			return dc.hitBreakpoint({ program: PROGRAM }, { path: PROGRAM, line: BREAKPOINT_LINE } );
		});

		test('hitting a lazy breakpoint should send a breakpoint event', () => {

			const PROGRAM = Path.join(DATA_ROOT, 'testLazyBreakpoint.md');
			const BREAKPOINT_LINE = 3;

			return Promise.all([

				dc.hitBreakpoint({ program: PROGRAM }, { path: PROGRAM, line: BREAKPOINT_LINE, verified: false } ),

				dc.waitForEvent('breakpoint').then((event : DebugProtocol.BreakpointEvent ) => {
					assert.equal(event.body.breakpoint.verified, true, "event mismatch: verified");
				})
//.........这里部分代码省略.........
开发者ID:Sauropod-Studio,项目名称:moonsharp,代码行数:101,代码来源:adapter.test.ts

示例5:

ipcMain.on('invoice-save', (event, clients, invoiceData, opts) => {
  invoice.savePdf(clients, invoiceData,
    path.join(__dirname, config.get('invoiceSavePath')))
})
开发者ID:ilmaria,项目名称:laskutus-electron,代码行数:4,代码来源:main.ts

示例6: pathExists

		return Promise.all(paths.map((dir) => pathExists(path.join(dir, name))));
开发者ID:mrmlnc,项目名称:npm-module-path,代码行数:1,代码来源:resolver.ts

示例7: setup

 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */

import {assert} from 'chai';
import * as path from 'path';
import {Analyzer, applyEdits, FSUrlLoader, makeParseLoader} from 'polymer-analyzer';

import {Linter} from '../../linter';
import {registry} from '../../registry';
import {WarningPrettyPrinter} from '../util';

const fixtures_dir = path.join(__dirname, '..', '..', '..', 'test');

suite('deprecated-css-custom-property-syntax', () => {
  let analyzer: Analyzer;
  let warningPrinter: WarningPrettyPrinter;
  let linter: Linter;

  setup(() => {
    analyzer = new Analyzer({urlLoader: new FSUrlLoader(fixtures_dir)});
    warningPrinter = new WarningPrettyPrinter();
    linter = new Linter(
        registry.getRules(['deprecated-css-custom-property-syntax']), analyzer);
  });

  test('works in the trivial case', async() => {
    const warnings = await linter.lint([]);
开发者ID:asdfg9822,项目名称:polymer-linter,代码行数:31,代码来源:deprecated-css-custom-property-syntax_test.ts

示例8: readDir

 .map((scope: string) => readDir(join(path, "node_modules", scope))
   .then((scoped) => scoped.map((f: string) => join(scope, f))),
开发者ID:FormidableLabs,项目名称:inspectpack,代码行数:2,代码来源:dependencies.ts

示例9: join

 .then((scoped) => scoped.map((f: string) => join(scope, f))),
开发者ID:FormidableLabs,项目名称:inspectpack,代码行数:1,代码来源:dependencies.ts

示例10: readPackage

 .then(() => readPackage(join(path, "package.json"), _cache))
开发者ID:FormidableLabs,项目名称:inspectpack,代码行数:1,代码来源:dependencies.ts


注:本文中的path.join函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。