makeup-next-id
Advanced tools
Comparing version 0.0.2 to 0.0.3
16
index.js
@@ -7,13 +7,13 @@ 'use strict'; | ||
module.exports = function (el) { | ||
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix; | ||
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultPrefix; | ||
// prevent empty string | ||
var _prefix = prefix === '' ? defaultPrefix : prefix; | ||
// prevent empty string | ||
var _prefix = prefix === '' ? defaultPrefix : prefix; // initialise prefix in sequence map if necessary | ||
// initialise prefix in sequence map if necessary | ||
sequenceMap[_prefix] = sequenceMap[_prefix] || 0; | ||
if (!el.id) { | ||
el.setAttribute('id', _prefix + '-' + sequenceMap[_prefix]++); | ||
} | ||
sequenceMap[_prefix] = sequenceMap[_prefix] || 0; | ||
if (!el.id) { | ||
el.setAttribute('id', "".concat(_prefix, "-").concat(sequenceMap[_prefix]++)); | ||
} | ||
}; |
{ | ||
"name": "makeup-next-id", | ||
"description": "Assign the next id in sequence to an element, if an id property does not already exist.", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "index.js", | ||
@@ -11,18 +11,18 @@ "repository": "https://github.com/makeup-js/makeup-next-id.git", | ||
"start": "npm run build && parallelshell \"npm run server\" \"npm run watch\"", | ||
"test": "npm run transpile && npm run lasso:test && npm run clean && karma start --autoWatch false --singleRun true", | ||
"prepublishOnly": "npm run clean && npm run lint && npm run test && npm run build", | ||
"build": "npm run transpile && npm run lasso", | ||
"test": "npm run build:module && npm run lasso:tests && karma start --autoWatch false --singleRun true", | ||
"prepublishOnly": "npm run lint && npm run test && npm run clean:tests && npm run build:docs", | ||
"prep": "npm run prepublishOnly", | ||
"build": "npm run build:module && npm run build:docs", | ||
"build:module": "babel src/index.js --out-file index.js", | ||
"build:docs": "babel docs/src/index.js --out-file docs/index.js && npm run lasso:docs && npm run clean:docs", | ||
"fix": "eslint src/index.js --fix", | ||
"lint": "eslint src/index.js > lint.txt", | ||
"lasso": "lasso require-run:./docs/index.js --out docs/static --inject-into docs/index.html --name bundle && npm run clean:lasso", | ||
"lasso:test": "lasso require-run:./test/index.js --name bundle-test --out test/static --config ./test/lasso-config.json && npm run clean:lasso", | ||
"clean": "rimraf reports .DS_Store test/.DS_Store src/.DS_Store docs/.DS_Store && npm run clean:lasso", | ||
"clean:lasso": "rimraf .cache build", | ||
"lint": "eslint src/index.js > lint.txt && eslint docs/src/index.js > lint.txt", | ||
"lasso:docs": "lasso require-run:./docs/index.js --out docs/static --inject-into docs/index.html --name bundle", | ||
"lasso:tests": "npm run clean:tests && lasso require-run:./test/index.js --name bundle-test --out test/static --config ./test/lasso-config.json", | ||
"clean:docs": "rimraf .cache build docs/index.js", | ||
"clean:tests": "rimraf lint.txt reports", | ||
"server": "browser-sync start -s --ss docs --index docs/index.html --files docs/index.html", | ||
"watch": "onchange src/*.js docs/index.js -- npm run build", | ||
"transpile": "babel src/index.js --out-file index.js" | ||
"watch": "onchange src/*.js docs/src/index.js -- npm run build", | ||
"version": "npm run prepublishOnly && git add -A docs/static test/static" | ||
}, | ||
"pre-commit": [ | ||
"prepublishOnly" | ||
], | ||
"keywords": [ | ||
@@ -35,19 +35,21 @@ "makeup", | ||
"devDependencies": { | ||
"babel-cli": "^6", | ||
"@babel/cli": "^7", | ||
"@babel/core": "^7", | ||
"@babel/preset-env": "^7", | ||
"babel-plugin-transform-object-assign": "^6", | ||
"babel-preset-env": "^1", | ||
"browser-sync": "^2", | ||
"core-js-pure": "^3", | ||
"coveralls": "^3", | ||
"eslint": "^4", | ||
"eslint-config-ebay": "~0.1", | ||
"jasmine-core": "^2", | ||
"karma": "^1", | ||
"eslint": "^5", | ||
"eslint-config-ebay": "^1", | ||
"jasmine-core": "^3", | ||
"karma": "^4", | ||
"karma-chrome-launcher": "^2", | ||
"karma-coverage": "^1", | ||
"karma-html-reporter": "~0.2", | ||
"karma-jasmine": "^1", | ||
"karma-phantomjs-launcher": "^1", | ||
"karma-jasmine": "^2", | ||
"lasso-cli": "^2", | ||
"onchange": "^3", | ||
"onchange": "^5", | ||
"parallelshell": "^3", | ||
"pre-commit": "^1", | ||
"puppeteer": "^1", | ||
"rimraf": "^2" | ||
@@ -54,0 +56,0 @@ }, |
@@ -67,2 +67,6 @@ # makeup-next-id | ||
## Polyfills | ||
* None | ||
## Development | ||
@@ -77,7 +81,2 @@ | ||
The following hooks exist, and do not need to be invoked manually: | ||
* `npm prepublishOnly` cleans, lints, tests and builds on every `npm publish` command | ||
* `pre-commit` cleans, lints, tests and builds on every `git commit` command | ||
## Test Reports | ||
@@ -84,0 +83,0 @@ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
253617
0
20
17
94