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


TypeScript shelljs.grep函數代碼示例

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


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

示例1: it

 it('should have its module resolution mappings defined in the nested package.json', () => {
   const packageJson = p `testing/package.json`;
   expect(shx.grep('"main":', packageJson)).toContain(`../bundles/core-testing.umd.js`);
   expect(shx.grep('"module":', packageJson)).toContain(`../esm5/testing.js`);
   expect(shx.grep('"es2015":', packageJson)).toContain(`../esm2015/testing.js`);
   expect(shx.grep('"typings":', packageJson)).toContain(`./testing.d.ts`);
 });
開發者ID:cironunes,項目名稱:angular,代碼行數:7,代碼來源:core_package.spec.ts

示例2: replaceVersionPlaceholders

 function replaceVersionPlaceholders(filePath: string) {
   if (stampData) {
     const version = shx.grep('BUILD_SCM_VERSION', stampData).split(' ')[1].trim();
     return shx.sed(/0.0.0-PLACEHOLDER/, version, filePath);
   }
   return shx.cat(filePath);
 }
開發者ID:robwormald,項目名稱:angular,代碼行數:7,代碼來源:packager.ts

示例3: replaceVersionPlaceholders

 function replaceVersionPlaceholders(filePath: string, content: string) {
   if (stampData) {
     const version = shx.grep('BUILD_SCM_VERSION', stampData).split(' ')[1].trim();
     // Split the replacement into separate strings so we don't match it while publishing
     return content.replace(
         new RegExp(
             '0.0.0' +
                 '-PLACEHOLDER',
             'g'),
         version);
   }
   return content;
 }
開發者ID:cironunes,項目名稱:angular,代碼行數:13,代碼來源:packager.ts

示例4: it

 it('should have the correct source map paths', () => {
   expect(shx.grep('sourceMappingURL', 'fesm5/common.js'))
       .toMatch('//# sourceMappingURL=common.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm2015/common.js'))
       .toMatch('//# sourceMappingURL=common.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm5/http.js'))
       .toMatch('//# sourceMappingURL=http.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm2015/http.js'))
       .toMatch('//# sourceMappingURL=http.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm5/http/testing.js'))
       .toMatch('//# sourceMappingURL=testing.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm2015/http/testing.js'))
       .toMatch('//# sourceMappingURL=testing.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm5/testing.js'))
       .toMatch('//# sourceMappingURL=testing.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm2015/testing.js'))
       .toMatch('//# sourceMappingURL=testing.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm5/upgrade.js'))
       .toMatch('//# sourceMappingURL=upgrade.js.map');
   expect(shx.grep('sourceMappingURL', 'fesm2015/upgrade.js'))
       .toMatch('//# sourceMappingURL=upgrade.js.map');
 });
開發者ID:marclaval,項目名稱:angular,代碼行數:22,代碼來源:common_package.spec.ts

示例5: it

 it('should contain correct version number with the PLACEHOLDER string replaced', () => {
   expect(shx.grep('"version":', packageJson)).toMatch(/\d+\.\d+\.\d+(?!-PLACEHOLDER)/);
 });
開發者ID:zackarychapple,項目名稱:angular,代碼行數:3,代碼來源:core_package.spec.ts

示例6: expect

 () => { expect(shx.grep('"name":', packageJson)).toContain(`@angular/core`); });
開發者ID:zackarychapple,項目名稱:angular,代碼行數:1,代碼來源:core_package.spec.ts

示例7: it

 it('should contain module resolution mappings', () => {
   expect(shx.grep('"main":', packageJson)).toContain(`dist/zone-node.js`);
 });
開發者ID:angular,項目名稱:zone.js,代碼行數:3,代碼來源:npm_package.spec.ts


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