11'use strict' ;
22
3- const Debug = require ( 'debug' ) ;
43const Yaml = require ( 'js-yaml' ) ;
54
65const Loader = require ( '../loader' ) ;
@@ -14,9 +13,6 @@ const internals = {
1413} ;
1514
1615
17- internals . log = Debug ( 'detect-node-support' ) ;
18-
19-
2016internals . normalizeImports = ( travisYaml , { relativeTo } ) => {
2117
2218 return Utils . toArray ( travisYaml . import )
@@ -53,12 +49,7 @@ internals.normalizeImports = (travisYaml, { relativeTo }) => {
5349} ;
5450
5551
56- internals . loadSource = async ( source , { loadFile, cache } ) => {
57-
58- if ( cache [ source ] ) {
59- internals . log ( 'Returning cached %s' , source ) ;
60- return cache [ source ] ;
61- }
52+ internals . loadSource = async ( source , { loadFile } ) => {
6253
6354 let path = source ;
6455
@@ -70,14 +61,11 @@ internals.loadSource = async (source, { loadFile, cache }) => {
7061 loadFile = loader . loadFile ;
7162 }
7263
73- internals . log ( 'Loading %s' , source ) ;
74- const result = await loadFile ( path ) ;
75- cache [ source ] = result ;
76- return result ;
64+ return loadFile ( path ) ;
7765} ;
7866
7967
80- exports . apply = async ( yaml , { loadFile, relativeTo, cache = new Map ( ) } ) => {
68+ exports . apply = async ( yaml , { loadFile, relativeTo } ) => {
8169
8270 if ( ! yaml . import ) {
8371 return ;
@@ -87,14 +75,14 @@ exports.apply = async (yaml, { loadFile, relativeTo, cache = new Map() }) => {
8775
8876 for ( const entry of imports ) {
8977
90- const buffer = await internals . loadSource ( entry . source , { loadFile, cache } ) ;
78+ const buffer = await internals . loadSource ( entry . source , { loadFile } ) ;
9179
9280 const imported = Yaml . safeLoad ( buffer , {
9381 schema : Yaml . FAILSAFE_SCHEMA ,
9482 json : true
9583 } ) ;
9684
97- await exports . apply ( imported , { loadFile, relativeTo : entry , cache } ) ;
85+ await exports . apply ( imported , { loadFile, relativeTo : entry } ) ;
9886
9987 delete imported . import ;
10088
0 commit comments