From 62c614fcce8c538fed933b676988f0e2219af614 Mon Sep 17 00:00:00 2001 From: hotoo Date: Mon, 24 Mar 2014 10:09:05 +0800 Subject: [PATCH] Fixed #23, extend(default, more.hasOwnProperty is not function) --- package.json | 4 ++-- src/pinyin.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9e52ed0..5846f65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "pinyin", - "version": "2.2.0", + "name": "pinyinjs", + "version": "2.2.1", "description": "汉语拼音转换工具。", "main": "src/pinyin.js", "bin": { diff --git a/src/pinyin.js b/src/pinyin.js index f642b08..579df02 100644 --- a/src/pinyin.js +++ b/src/pinyin.js @@ -101,7 +101,6 @@ function single_pinyin(han, options){ return single_pinyin(han.charAt(0), options); } - options = extend(DEFAULT_OPTIONS, options); var hanCode = han.charCodeAt(0); if(!PINYIN_DICT[hanCode]){return [han];} @@ -155,7 +154,7 @@ function pinyin(hans, options){ if("string" !== typeof hans){return [];} - options = extend(DEFAULT_OPTIONS, options); + options = extend(DEFAULT_OPTIONS, options || {}); var phrases = segment.doSegment(hans); var len = hans.length;