Last active
December 2, 2019 01:21
-
-
Save whs/5139150212a42ac3f785491126d256cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| const yaml = require('js-yaml') | |
| module.exports = function(content) { | |
| // Load ไฟล์ภาษา | |
| const content = content || fs.readFileSync(this.resourcePath) | |
| let lang = yaml.safeLoad(content, { | |
| schema: yaml.FAILSAFE_SCHEMA, | |
| }) | |
| const string = lang[this.resourceQuery] | |
| return `export default ${JSON.stringify(string)}` | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment