nemo-locatex
Advanced tools
Comparing version 0.1.1 to 0.1.2
22
index.js
@@ -5,3 +5,3 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
│ │ | ||
│ Licensed under the Apache License, Version 2.0 (the "License"); you may │ | ||
│ Licensed under the Apache License, Version 2.0 (the 'License'); you may │ | ||
│ not use this file except in compliance with the License. You may obtain │ | ||
@@ -11,3 +11,3 @@ │ a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 │ | ||
│ Unless required by applicable law or agreed to in writing, software │ | ||
│ distributed under the License is distributed on an "AS IS" BASIS, │ | ||
│ distributed under the License is distributed on an 'AS IS' BASIS, │ | ||
│ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │ | ||
@@ -17,20 +17,18 @@ │ See the License for the specific language governing permissions and │ | ||
\*───────────────────────────────────────────────────────────────────────────*/ | ||
/* global module: true, require: true, console: true */ | ||
"use strict"; | ||
var async = require("async"); | ||
/* global module: true */ | ||
'use strict'; | ||
module.exports = { | ||
"setup": function (config, result, callback) { | ||
'setup': function (config, result, callback) { | ||
var returnObj = result; | ||
returnObj.locatex = (function locatex(_locator) { | ||
var locale = (result.props && result.props.locale) ? result.props.locale : "default", | ||
returnObj.locatex = function locatex(_locator) { | ||
var locale = (result.props && result.props.locale) ? result.props.locale : 'default', | ||
locatr = this.locator; | ||
_locator.split(".").forEach(function (level) { | ||
_locator.split('.').forEach(function (level) { | ||
locatr = locatr[level]; | ||
}); | ||
return locatr[locale] || locatr["default"] || locatr; | ||
return locatr[locale] || locatr['default'] || locatr; | ||
}).bind(result); | ||
}.bind(result); | ||
callback(null, config, returnObj); | ||
} | ||
}; |
{ | ||
"name": "nemo-locatex", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Add Locale behavior to Nemo locators", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "grunt" | ||
}, | ||
@@ -13,2 +13,3 @@ "repository": { | ||
}, | ||
"registerAs": "locatex", | ||
"dependencies": { | ||
@@ -20,2 +21,9 @@ "async": "~0.2.8" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.10.0", | ||
"chai": "~1.6.0", | ||
"grunt": "~0.4.1", | ||
"grunt-simple-mocha": "~0.4.0", | ||
"grunt-contrib-jshint": "~0.7.1" | ||
}, | ||
"keywords": [ | ||
@@ -22,0 +30,0 @@ "Nemo", |
@@ -5,2 +5,4 @@ ## nemo-locatex | ||
[![Build Status](https://travis-ci.org/paypal/nemo-drivex.svg?branch=master)](https://travis-ci.org/paypal/nemo-drivex) | ||
### Installation | ||
@@ -7,0 +9,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
13573
10
77
2
118
5