fis-smarty模块的-map.json中资源定位符的namespace特征是否遗漏?

更新于
2026-09-29 12:02:57
1阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计236个文字,预计阅读时间需要1分钟。

fis-smarty模块的-map.json中资源定位符的namespace特征是否遗漏?

javascriptvalidate-fis-map.js检查fis-smarty模块的+-map.json中资源定位符是否丢失了namespace特性用法: node validate.js

use strict;var fs=require('fs');var file=process.argv.slice(2);

if (!file) { console.log('请提供要检查的文件路径');} else { fs.readFile(file, 'utf8', function(err, data) { if (err) { console.error('读取文件出错:', err); return; } try { const map=JSON.parse(data); const resources=map.files; resources.forEach(function(resource) { if (!resource.resource) { console.error('资源定位符丢失:', resource); } }); } catch (e) { console.error('解析map.json出错:', e); } });}

validate-fis-map.js

/** * 检查 fis-smarty 模块的 -map.json 中资源定位符是否丢失了 namespace 特征 * @用法 node valide.js -map.json */ "use strict" var fs = require('fs') var file = process.argv.slice(2) if( !file ){ console.log('指定 -map.json 文件!') return } console.log( `file name:${file}`) var content = fs.readFileSync( file.toString() ) if( !content ){ console.log('文件内容为空!') return } var json = JSON.parse( content ) var bad = Object.keys( json.res ).filter( res => { // console.log( res ) return res.indexOf(':') < 0 }) if( bad.length ){ console.log( '发现丢失 namespace 的资源:') console.log( bad ) } else{ console.log( '没有发现丢失 namespace 的资源。') }

fis-smarty模块的-map.json中资源定位符的namespace特征是否遗漏?
标签:mapjson中

本文共计236个文字,预计阅读时间需要1分钟。

fis-smarty模块的-map.json中资源定位符的namespace特征是否遗漏?

javascriptvalidate-fis-map.js检查fis-smarty模块的+-map.json中资源定位符是否丢失了namespace特性用法: node validate.js

use strict;var fs=require('fs');var file=process.argv.slice(2);

if (!file) { console.log('请提供要检查的文件路径');} else { fs.readFile(file, 'utf8', function(err, data) { if (err) { console.error('读取文件出错:', err); return; } try { const map=JSON.parse(data); const resources=map.files; resources.forEach(function(resource) { if (!resource.resource) { console.error('资源定位符丢失:', resource); } }); } catch (e) { console.error('解析map.json出错:', e); } });}

validate-fis-map.js

/** * 检查 fis-smarty 模块的 -map.json 中资源定位符是否丢失了 namespace 特征 * @用法 node valide.js -map.json */ "use strict" var fs = require('fs') var file = process.argv.slice(2) if( !file ){ console.log('指定 -map.json 文件!') return } console.log( `file name:${file}`) var content = fs.readFileSync( file.toString() ) if( !content ){ console.log('文件内容为空!') return } var json = JSON.parse( content ) var bad = Object.keys( json.res ).filter( res => { // console.log( res ) return res.indexOf(':') < 0 }) if( bad.length ){ console.log( '发现丢失 namespace 的资源:') console.log( bad ) } else{ console.log( '没有发现丢失 namespace 的资源。') }

fis-smarty模块的-map.json中资源定位符的namespace特征是否遗漏?
标签:mapjson中