Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
  • Loading branch information
Richienb committed May 6, 2020
1 parent 6eed5be commit b55f3f2
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 3,666 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = tab

[*.md]
trim_trailing_whitespace = false
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Lockfiles

package-lock.json
yarn.lock

# Visual Studio Code

.vscode/*
Expand Down Expand Up @@ -158,15 +163,18 @@ typings/
# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
# Next.js build output
.next

# nuxt.js build output
# Nuxt.js build / generate output
.nuxt
dist

# gatsby files
# Gatsby files
.cache/
public
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist
Expand All @@ -182,3 +190,6 @@ public

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Richie Bendall
Copyright (c) 2019 - 2020 Richie Bendall

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
* //=> '1.0.0'
* ```
*/
declare function cleanSemver(version: string): string;
declare function cleanSemver(version: string): string

export = cleanSemver;
export = cleanSemver
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

const semver = require("semver")

module.exports = (version) => semver.valid(semver.coerce(version))
module.exports = version => {
if (typeof version !== "string") {
throw new TypeError(`Expected a string, got ${typeof version}`)
}

return semver.valid(semver.coerce(version))
}
71 changes: 37 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
{
"name": "clean-semver",
"version": "1.0.1",
"description": "Clean a semver-compatible version.",
"repository": "https://github.com/Richienb/clean-semver.git",
"author": "Richie Bendall <richiebendall@gmail.com>",
"license": "MIT",
"main": "index.js",
"files": [
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=4"
},
"scripts": {
"lint": "eslint .",
"test": "yarn lint && ava"
},
"keywords": [
"semver",
"clean",
"version"
],
"dependencies": {
"semver": "^7.1.1"
},
"devDependencies": {
"ava": "^2.1.0",
"eslint": "^6.6.0",
"eslint-config-richienb": "^0.2.2"
},
"eslintConfig": {
"extends": "richienb/node"
}
"name": "clean-semver",
"version": "1.0.1",
"description": "Clean a semver-compatible version.",
"repository": "https://github.com/Richienb/clean-semver.git",
"author": "Richie Bendall <richiebendall@gmail.com>",
"license": "MIT",
"main": "index.js",
"files": [
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=10"
},
"scripts": {
"lint": "xo",
"test": "yarn lint && ava"
},
"keywords": [
"semver",
"clean",
"version"
],
"dependencies": {
"semver": "^7.3.2"
},
"devDependencies": {
"ava": "^3.8.1",
"eslint-config-richienb": "^0.4.2",
"xo": "^0.30.0"
},
"resolutions": {
"eslint": "^6.8.0"
},
"xo": {
"extends": "richienb"
}
}
8 changes: 4 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from "ava"
import cleanSemver from "."
const test = require("ava")
const cleanSemver = require(".")

test("main", (t) => {
t.is(cleanSemver(" v1.0aaa -"), "1.0.0")
test("main", t => {
t.is(cleanSemver(" v1.0aaa -"), "1.0.0")
})

0 comments on commit b55f3f2

Please sign in to comment.