當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。