Comparing version 1.0.36 to 1.0.37
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const util_1 = require("../util"); | ||
/** | ||
@@ -18,3 +19,3 @@ * 資料來源 https://www.jpmarumaru.com/tw/teachKanjiComparison.asp | ||
const teachKanjiComparison = require('./teachKanjiComparison.json'); | ||
const PLUS_TABLE = [ | ||
const PLUS_TABLE = util_1.array_unique([ | ||
['蝕', '蝕', '蚀'], | ||
@@ -43,4 +44,6 @@ ["絲", "絲", "丝"], | ||
['棄', '棄', '弃'], | ||
]; | ||
const PLUS_TABLE_SAFE = [ | ||
['強', '強', '强'], | ||
['罵', '罵', '骂'], | ||
]); | ||
const PLUS_TABLE_SAFE = util_1.array_unique([ | ||
["歴", "歷", "历"], | ||
@@ -50,3 +53,3 @@ ["絶", "絕", "绝"], | ||
["魯", "魯", "鲁"], | ||
]; | ||
]); | ||
exports.TABLE = []; | ||
@@ -56,3 +59,3 @@ PLUS_TABLE.forEach(function ([jp, zht, zhs]) { | ||
}); | ||
exports.TABLE = exports.TABLE.concat(teachKanjiComparison); | ||
exports.TABLE = util_1.array_unique(exports.TABLE.concat(teachKanjiComparison)); | ||
exports.TABLE_SAFE = []; | ||
@@ -59,0 +62,0 @@ { |
@@ -12,2 +12,3 @@ /** | ||
import * as fs from 'fs'; | ||
import { array_unique } from '../util'; | ||
@@ -22,3 +23,3 @@ /** | ||
const PLUS_TABLE: IPLUS_TABLE = [ | ||
const PLUS_TABLE: IPLUS_TABLE = array_unique<IPLUS_TABLE>([ | ||
['蝕', '蝕', '蚀'], | ||
@@ -61,7 +62,10 @@ ["絲", "絲", "丝"], | ||
['棄', '棄', '弃'], | ||
['強', '強', '强'], | ||
]; | ||
['罵', '罵', '骂'], | ||
const PLUS_TABLE_SAFE: IPLUS_TABLE = [ | ||
]); | ||
const PLUS_TABLE_SAFE: IPLUS_TABLE = array_unique([ | ||
["歴", "歷", "历"], | ||
@@ -71,4 +75,5 @@ ["絶", "絕", "绝"], | ||
["魯", "魯", "鲁"], | ||
]; | ||
] as IPLUS_TABLE); | ||
export let TABLE = [] as string[][]; | ||
@@ -81,3 +86,3 @@ | ||
TABLE = TABLE.concat(teachKanjiComparison); | ||
TABLE = array_unique(TABLE.concat(teachKanjiComparison)); | ||
@@ -84,0 +89,0 @@ export let TABLE_SAFE = [] as string[][]; |
@@ -0,5 +1,5 @@ | ||
export { array_unique, lazy_unique } from 'array-hyper-unique'; | ||
export interface IcharCodeAtFn { | ||
(char: any, charCode: any, str: any): any; | ||
} | ||
export declare function array_unique(array: any[]): any[]; | ||
export declare function split(str: any): string[]; | ||
@@ -6,0 +6,0 @@ export declare function charCodeAt(str: any, cb?: IcharCodeAtFn): number[]; |
@@ -7,8 +7,17 @@ "use strict"; | ||
const uni_string_1 = require("uni-string"); | ||
function array_unique(array) { | ||
return (array).filter(function (el, index, arr) { | ||
var array_hyper_unique_1 = require("array-hyper-unique"); | ||
exports.array_unique = array_hyper_unique_1.array_unique; | ||
exports.lazy_unique = array_hyper_unique_1.lazy_unique; | ||
/* | ||
export function array_unique<T>(array: T): T | ||
{ | ||
return arrUniq(array); | ||
return (array).filter(function (el, index, arr) | ||
{ | ||
return index == arr.indexOf(el); | ||
}); | ||
} | ||
exports.array_unique = array_unique; | ||
*/ | ||
function split(str) { | ||
@@ -15,0 +24,0 @@ return uni_string_1.default.split(str, ''); |
@@ -6,2 +6,3 @@ /** | ||
import UString from 'uni-string'; | ||
export { array_unique, lazy_unique } from 'array-hyper-unique'; | ||
@@ -13,4 +14,7 @@ export interface IcharCodeAtFn | ||
export function array_unique(array: any[]) | ||
/* | ||
export function array_unique<T>(array: T): T | ||
{ | ||
return arrUniq(array); | ||
return (array).filter(function (el, index, arr) | ||
@@ -20,3 +24,5 @@ { | ||
}); | ||
} | ||
*/ | ||
@@ -23,0 +29,0 @@ export function split(str): string[] |
@@ -66,2 +66,3 @@ /** | ||
'国': string[]; | ||
'罵': string[]; | ||
}; | ||
@@ -68,0 +69,0 @@ export interface ISimpleTable { |
@@ -252,2 +252,7 @@ "use strict"; | ||
], | ||
'罵': [ | ||
'罵', | ||
'骂', | ||
'駡', | ||
], | ||
}; | ||
@@ -254,0 +259,0 @@ Object.keys(exports.table_plus) |
@@ -269,2 +269,8 @@ /** | ||
'罵': [ | ||
'罵', | ||
'骂', | ||
'駡', | ||
], | ||
}; | ||
@@ -271,0 +277,0 @@ |
{ | ||
"name": "cjk-conv", | ||
"version": "1.0.36", | ||
"version": "1.0.37", | ||
"description": "convert chinese, japanese 簡繁日漢字轉換 ( merge/split submodule from node-novel, regexp-cjk, str-util )", | ||
@@ -63,3 +63,5 @@ "keywords": [ | ||
"dependencies": { | ||
"array-hyper-unique": "^1.0.0", | ||
"chinese_convert": "^1.0.8", | ||
"deep-eql": "^3.0.1", | ||
"deepmerge-plus": "^2.1.1", | ||
@@ -66,0 +68,0 @@ "japanese": "^1.2.0", |
412213
6
36
38294
+ Addedarray-hyper-unique@^1.0.0
+ Addeddeep-eql@^3.0.1
+ Addedarray-hyper-unique@1.1.10(transitive)
+ Addeddeep-eql@3.0.14.1.4(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedtype-detect@4.1.0(transitive)