chore: update to Node.js LTS

This commit is contained in:
Yang Jun
2026-07-09 00:58:42 +08:00
parent 7ab49f999a
commit 962e5b6433
15 changed files with 26 additions and 46 deletions
-5
View File
@@ -2,11 +2,6 @@ import * as base64 from './base64-impl-browser'
import { JSDOM } from 'jsdom'
describe('base64-impl/browser', function () {
if (+(process.version.match(/^v(\d+)/) as RegExpMatchArray)[1] < 8) {
console.info('jsdom not supported, skipping base64-impl-browser...')
return
}
beforeEach(function () {
const dom = new JSDOM(``, {
url: 'https://example.com/',
-4
View File
@@ -3,10 +3,6 @@ import * as sinon from 'sinon'
import { JSDOM } from 'jsdom'
describe('fs/browser', function () {
if (+(process.version.match(/^v(\d+)/) as RegExpMatchArray)[1] < 8) {
console.info('jsdom not supported, skipping template-browser...')
return
}
beforeEach(function () {
const dom = new JSDOM(``, {
url: 'https://example.com/foo/bar/',
+1 -1
View File
@@ -46,7 +46,7 @@ export function * sort_natural<T> (this: FilterImpl, arr: T[], property?: string
return yield * sortBy.call(this, arr, property, caseInsensitiveCompare)
}
export const size = (v: string | any[]) => (v && v.length) || 0
export const size = (v: string | any[]) => v?.length || 0
export function * map (this: FilterImpl, arr: Scope[], property: string): IterableIterator<unknown> {
const results = []
+4 -4
View File
@@ -204,11 +204,11 @@ export const defaultOptions: NormalizedFullOptions = {
}
export function normalize (options: LiquidOptions): NormalizedFullOptions {
if (options.hasOwnProperty('root')) {
if (!options.hasOwnProperty('partials')) options.partials = options.root
if (!options.hasOwnProperty('layouts')) options.layouts = options.root
if ('root' in options) {
if (!('partials' in options)) options.partials = options.root
if (!('layouts' in options)) options.layouts = options.root
}
if (options.hasOwnProperty('cache')) {
if ('cache' in options) {
let cache: LiquidCache | undefined
if (typeof options.cache === 'number') cache = options.cache > 0 ? new LRU(options.cache) : undefined
else if (typeof options.cache === 'object') cache = options.cache
+2 -4
View File
@@ -1,10 +1,9 @@
import { Drop } from '../drop/drop'
export const toString = Object.prototype.toString
export const hasOwnProperty = Object.prototype.hasOwnProperty
const toLowerCase = String.prototype.toLowerCase
export const hasOwnProperty = Object.hasOwnProperty
export function isString (value: any): value is string {
return typeof value === 'string'
}
@@ -90,8 +89,7 @@ export function isUndefined (value: any): boolean {
}
export function isArray (value: any): value is any[] {
// be compatible with IE 8
return toString.call(value) === '[object Array]'
return Array.isArray(value)
}
export function isArrayLike (value: any): value is any[] {