Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ilib-casemapper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ilib-casemapper - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

lib/CaseMapper.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _ilibEnv=require("ilib-env");var _ilibLocale=_interopRequireDefault(require("ilib-locale"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key)}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}var CaseMapper=function(){function CaseMapper(options){_classCallCheck(this,CaseMapper);this.up=true;this.locale=new _ilibLocale["default"];if(options){if(typeof options.locale!=="undefined"){this.locale=typeof options.locale==="string"?new _ilibLocale["default"](options.locale):options.locale}this.up=!options.direction||options.direction==="toupper"}this.mapData=this.up?{"\xDF":"SS","\u0390":"\u0399","\u03AC":"\u0391","\u03AD":"\u0395","\u03AE":"\u0397","\u03AF":"\u0399","\u03B0":"\u03A5","\u03CA":"\u0399","\u03CB":"\u03A5","\u03CC":"\u039F","\u03CD":"\u03A5","\u03CE":"\u03A9","\u04C0":"\u04C0","\u04CF":"\u04C0"}:{"\u04C0":"\u04C0"};switch(this.locale.getLanguage()){case"az":case"tr":case"crh":case"kk":case"krc":case"tt":var lower="i\u0131";var upper="\u0130I";this.setUpMap(lower,upper);break}var browser=(0,_ilibEnv.getBrowser)();if(browser==="ie"||browser==="Edge"){if(this.up){this.mapData["\u03C2"]="\u03A3"}this.setUpMap("\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CC1\u2CC9\u2CCB","\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CC0\u2CC8\u2CCA");this.setUpMap("\u2D00\u2D01\u2D02\u2D03\u2D04\u2D05\u2D06\u2D07\u2D08\u2D09\u2D0A\u2D0B\u2D0C\u2D0D\u2D0E\u2D0F\u2D10\u2D11\u2D12\u2D13\u2D14\u2D15\u2D16\u2D17\u2D18\u2D19\u2D1A\u2D1B\u2D1C\u2D1D\u2D1E\u2D1F\u2D20\u2D21\u2D22\u2D23\u2D24\u2D25","\u10A0\u10A1\u10A2\u10A3\u10A4\u10A5\u10A6\u10A7\u10A8\u10A9\u10AA\u10AB\u10AC\u10AD\u10AE\u10AF\u10B0\u10B1\u10B2\u10B3\u10B4\u10B5\u10B6\u10B7\u10B8\u10B9\u10BA\u10BB\u10BC\u10BD\u10BE\u10BF\u10C0\u10C1\u10C2\u10C3\u10C4\u10C5")}}_createClass(CaseMapper,[{key:"charMapper",value:function charMapper(string){if(!string){return string}var ret="";var i,c;for(i=0;i<string.length;i++){c=string[i];if(!this.up&&c==="\u03A3"){if(i+1<string.length){i++;c=string[i];var code=c.charCodeAt(0);ret+=code<904&&code!==902||code>974?"\u03C2":"\u03C3";ret+=c.toLowerCase()}else{ret+="\u03C2"}}else{if(this.mapData[c]){ret+=this.mapData[c]}else{ret+=this.up?c.toUpperCase():c.toLowerCase()}}}return ret}},{key:"setUpMap",value:function setUpMap(lower,upper){var from,to;if(this.up){from=lower;to=upper}else{from=upper;to=lower}for(var i=0;i<upper.length;i++){this.mapData[from[i]]=to[i]}}},{key:"getLocale",value:function getLocale(){return this.locale}},{key:"map",value:function map(string){return this.charMapper(string)}}]);return CaseMapper}();;var _default=CaseMapper;exports["default"]=_default;module.exports=exports.default;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _ilibEnv=require("ilib-env");var _ilibLocale=_interopRequireDefault(require("ilib-locale"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:String(i)}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var CaseMapper=function(){function CaseMapper(options){_classCallCheck(this,CaseMapper);this.up=true;this.locale=new _ilibLocale["default"];if(options){if(typeof options.locale!=="undefined"){this.locale=typeof options.locale==="string"?new _ilibLocale["default"](options.locale):options.locale}this.up=!options.direction||options.direction==="toupper"}this.mapData=this.up?{"\xDF":"SS","\u0390":"\u0399","\u03AC":"\u0391","\u03AD":"\u0395","\u03AE":"\u0397","\u03AF":"\u0399","\u03B0":"\u03A5","\u03CA":"\u0399","\u03CB":"\u03A5","\u03CC":"\u039F","\u03CD":"\u03A5","\u03CE":"\u03A9","\u04C0":"\u04C0","\u04CF":"\u04C0"}:{"\u04C0":"\u04C0"};switch(this.locale.getLanguage()){case"az":case"tr":case"crh":case"kk":case"krc":case"tt":var lower="i\u0131";var upper="\u0130I";this.setUpMap(lower,upper);break}var browser=(0,_ilibEnv.getBrowser)();if(browser==="ie"||browser==="Edge"){if(this.up){this.mapData["\u03C2"]="\u03A3"}this.setUpMap("\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CC1\u2CC9\u2CCB","\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CC0\u2CC8\u2CCA");this.setUpMap("\u2D00\u2D01\u2D02\u2D03\u2D04\u2D05\u2D06\u2D07\u2D08\u2D09\u2D0A\u2D0B\u2D0C\u2D0D\u2D0E\u2D0F\u2D10\u2D11\u2D12\u2D13\u2D14\u2D15\u2D16\u2D17\u2D18\u2D19\u2D1A\u2D1B\u2D1C\u2D1D\u2D1E\u2D1F\u2D20\u2D21\u2D22\u2D23\u2D24\u2D25","\u10A0\u10A1\u10A2\u10A3\u10A4\u10A5\u10A6\u10A7\u10A8\u10A9\u10AA\u10AB\u10AC\u10AD\u10AE\u10AF\u10B0\u10B1\u10B2\u10B3\u10B4\u10B5\u10B6\u10B7\u10B8\u10B9\u10BA\u10BB\u10BC\u10BD\u10BE\u10BF\u10C0\u10C1\u10C2\u10C3\u10C4\u10C5")}}_createClass(CaseMapper,[{key:"charMapper",value:function charMapper(string){if(!string){return string}var ret="";var i,c;for(i=0;i<string.length;i++){c=string[i];if(!this.up&&c==="\u03A3"){if(i+1<string.length){i++;c=string[i];var code=c.charCodeAt(0);ret+=code<904&&code!==902||code>974?"\u03C2":"\u03C3";ret+=c.toLowerCase()}else{ret+="\u03C2"}}else{if(this.mapData[c]){ret+=this.mapData[c]}else{ret+=this.up?c.toUpperCase():c.toLowerCase()}}}return ret}},{key:"setUpMap",value:function setUpMap(lower,upper){var from,to;if(this.up){from=lower;to=upper}else{from=upper;to=lower}for(var i=0;i<upper.length;i++){this.mapData[from[i]]=to[i]}}},{key:"getLocale",value:function getLocale(){return this.locale}},{key:"map",value:function map(string){return this.charMapper(string)}}]);return CaseMapper}();;var _default=exports["default"]=CaseMapper;module.exports=exports.default;
//# sourceMappingURL=CaseMapper.js.map
{
"name": "ilib-casemapper",
"version": "1.0.0",
"version": "1.0.1",
"main": "./lib/CaseMapper.js",

@@ -63,22 +63,24 @@ "module": "./src/CaseMapper.js",

"build:pkg": "echo '{\"type\": \"commonjs\"}' > lib/package.json",
"build:webtest": "webpack-cli --env dev --config webpack-test.config.js",
"build:web": "webpack-cli --env dev --config webpack-test.config.js",
"dist": "npm-run-all doc build:prod build:pkg; npm pack",
"test:cli": "LANG=en_US.UTF8 npm-run-all build:dev build:pkg ; bash test/testSuite.sh",
"test:web": "LANG=en_US.UTF8 npm run build:test ; open-cli ./test/testSuite.html ; open-cli ./test/testSuite.html -- firefox",
"test": "LANG=en_US.UTF8 npm-run-all build:dev test:cli",
"test:all": "LANG=en_US.UTF8 npm-run-all test:cli test:web",
"debug": "npm run build:dev ; node --inspect-brk test/testSuite.js",
"test": "npm-run-all build:dev test:all",
"test:cli": "LANG=en_US.UTF8 npm run build:dev ; node --experimental-vm-modules node_modules/.bin/jest --testEnvironment node",
"test:web": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/.bin/karma start --reporters dots --single-run",
"test:watch": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/.bin/jest --testEnvironment node --watch",
"test:all": "npm-run-all test:cli test:web",
"debug": "npm run build:dev ; node --experimental-vm-modules --inspect-brk node_modules/.bin/jest --testEnvironment node -i",
"debug:web": "LANG=en_US.UTF8 node --experimental-vm-modules node_modules/.bin/karma start --reporters dots",
"clean": "git clean -f -d src test ; rm -rf lib *.tgz",
"doc": "mkdir -p docs ; jsdoc2md -c jsdoc.json --separators --source src/* -m table > docs/CaseMapper.md",
"doc:html": "jsdoc -c jsdoc.json"
"doc:html": "jsdoc -c jsdoc.json",
"prepare": "conditional-install"
},
"devDependencies": {
"@babel/core": "^7.22.11",
"@babel/preset-env": "^7.22.14",
"@babel/register": "^7.22.5",
"@babel/runtime": "^7.22.11",
"assertextras": "^1.1.0",
"babel-loader": "^9.1.3",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/register": "^7.23.7",
"@babel/runtime": "^7.23.8",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-module-resolver": "^5.0.0",
"conditional-install": "^1.0.1",
"docdash": "^2.0.2",

@@ -95,13 +97,27 @@ "grunt": "^1.6.1",

"jsdoc-to-markdown": "^8.0.0",
"karma": "^6.4.2",
"karma-assert": "^1.0.1",
"karma-chrome-launcher": "^3.2.0",
"karma-jasmine": "^5.1.0",
"karma-webpack": "^5.0.0",
"load-grunt-tasks": "^5.1.0",
"nodeunit": "^0.11.3",
"npm-run-all": "^4.1.5",
"open-cli": "^7.2.0",
"webpack": "^5.88.2",
"ucd-full": "^15.1.0",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"ilib-env": "^1.3.2",
"ilib-env": "^1.3.3",
"ilib-locale": "^1.2.2"
},
"conditionalDependencies": {
"process.versions.node < v14.0.0": {
"jest": "^26.0.0",
"babel-loader": "^8.0.0"
},
"process.versions.node >= v14.0.0": {
"jest": "^29.7.0",
"babel-loader": "^9.0.0"
}
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc