Skip to content

Commit

Permalink
Merge pull request #6 from imglab-io/v0.3.0
Browse files Browse the repository at this point in the history
v0.3.0
  • Loading branch information
jfcalvo authored Jan 13, 2023
2 parents 6e162ef + 2323824 commit 69b7c7b
Show file tree
Hide file tree
Showing 22 changed files with 4,303 additions and 430 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18', '17', '16', '15', '14']
node: ['19', '18', '17', '16', '15', '14']
container: node:${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Restore dependencies cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
Expand Down
312 changes: 307 additions & 5 deletions README.md

Large diffs are not rendered by default.

226 changes: 149 additions & 77 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@imglab/core",
"source": "src/index.js",
"version": "0.2.1",
"version": "0.3.0",
"description": "Official imglab Javascript library",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
6 changes: 3 additions & 3 deletions src/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default class Color {
'yellowgreen'
]

static color() {
static color () {
if (arguments.length === 1 && Color.#COLORS.includes(arguments[0])) {
return arguments[0]
}
Expand All @@ -166,11 +166,11 @@ export default class Color {
throw new Error('Invalid color')
}

static #areValidComponents() {
static #areValidComponents () {
return [...arguments].every((component) => { return Color.#isValidComponent(component) })
}

static #isValidComponent(component) {
static #isValidComponent (component) {
return Number.isInteger(component) && component >= 0 && component <= 255
}
}
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import Url from './url'
import Srcset from './srcset'
import Source from './source'
import Color from './color'
import Position from './position'
import Range from './range'
import Sequence from './sequence'

const url = Url.url
const srcset = Srcset.srcset
const color = Color.color
const position = Position.position
const range = Range.range
const sequence = Sequence.sequence

export default { url, Source, color, position }
export default { url, srcset, Source, color, position, Range, range, sequence }
Loading

0 comments on commit 69b7c7b

Please sign in to comment.