-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
53 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{ | ||
"linux": { | ||
"options: use default(undefined)": "C", | ||
"options: {\"spawn\":false}": "en-US", | ||
"options: {\"spawn\":true,\"cache\":false}": "C", | ||
"options: {\"spawn\":false,\"cache\":false}": "en-US" | ||
"options: {spawn:false}": "en-US", | ||
"options: {spawn:true,cache:false}": "C", | ||
"options: {spawn:false,cache:false}": "en-US" | ||
}, | ||
"win32": { | ||
"options: use default(undefined)": "ja-JP", | ||
"options: {\"spawn\":false}": "ja-JP", | ||
"options: {\"spawn\":true,\"cache\":false}": "ja-JP", | ||
"options: {\"spawn\":false,\"cache\":false}": "en-US" | ||
"options: {spawn:false}": "ja-JP", | ||
"options: {spawn:true,cache:false}": "ja-JP", | ||
"options: {spawn:false,cache:false}": "en-US" | ||
}, | ||
"darwin": { | ||
"options: use default(undefined)": "en-US", | ||
"options: {\"spawn\":false}": "en-US", | ||
"options: {\"spawn\":true,\"cache\":false}": "en-US", | ||
"options: {\"spawn\":false,\"cache\":false}": "en-US" | ||
"options: {spawn:false}": "en-US", | ||
"options: {spawn:true,cache:false}": "en-US", | ||
"options: {spawn:false,cache:false}": "en-US" | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/*! | ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
Copyright (C) 2020 jeffy-g <[email protected]> | ||
Released under the MIT license | ||
https://opensource.org/licenses/mit-license.php | ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
*/ | ||
// @ts-ignore | ||
/// <reference path="./index.d.ts"/> | ||
// @ts-ignore | ||
/// <reference path="../src/index.d.ts"/> | ||
const fs = require("fs"); | ||
/** | ||
* @typedef {typeof process.platform} TOSTokens | ||
|
@@ -33,10 +31,14 @@ const fs = require("fs"); | |
* @type {NsOsLocale.LocaleDetector} | ||
*/ | ||
let osLocale; | ||
// @ts-ignore | ||
/** | ||
* @param {TGThisKeys} varName | ||
* @param {boolean} fallback | ||
* @returns {boolean} | ||
*/ | ||
const ifDefined = (varName, fallback) => typeof global[varName] !== "undefined" ? global[varName] : fallback; | ||
// @ts-ignore | ||
const debug = ifDefined("printSync", false); | ||
const asyncDebug = ifDefined("printAsync", false); | ||
const DEFAULT = 1; | ||
const WIN = 1; | ||
const LINUX = 1; | ||
|
@@ -115,11 +117,10 @@ const emitCallback = (localeResult, detectorOpt, async) => async () => { | |
if (!root) { | ||
root = localeResult[process.platform] = {}; | ||
} | ||
root[`options: ${opt ? JSON.stringify(opt).replace(/\\"/g, "") : "use default(undefined)"}`] = locale; | ||
root[`options: ${opt ? JSON.stringify(opt).replace(/"/g, "") : "use default(undefined)"}`] = locale; | ||
debug && printInfo(async ? "async " : "", locale, opt); | ||
tryMatch(locale); | ||
}; | ||
|
||
eachModule("."); | ||
/** | ||
* @param {string} path module path `"../src/"(.ts)` or `"../dist/"(.js)` | ||
|